python3: ImportError: No module named 'wx'

3,219 views
Skip to first unread message

Bzzzz

unread,
Mar 5, 2015, 12:02:54 AM3/5/15
to wxpytho...@googlegroups.com
debian sid
wx 3.0.2-1+b1
=====================

Hi list,

When trying to import wx (which packages are almost all installed),
I can't :'(

I must miss some preparation, as the result of sys.path is very thin
compared to python 2.7:

P3:
===
['', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/usr/lib/python3.4/lib-dynload',
'/usr/local/lib/python3.4/dist-packages',
'/usr/lib/python3/dist-packages']

P2:
===
['',
'/usr/local/lib/python2.7/dist-packages/backports.ssl_match_hostname-3.4.0.2-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/certifi-14.05.14-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/pyflakes-0.8.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/mprpc-0.1.2-py2.7-linux-x86_64.egg',
'/usr/local/lib/python2.7/dist-packages/gsocketpool-0.1.3-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/SquareMap-1.0.4-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/RunSnakeRun-2.0.4-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/serpent-1.8-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/ObjectListView-1.3.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/Pyro4-4.34-py2.7.egg',
'/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']


how can I correct this to have the same pkgs/eggs availability under P3?

Jean-Yves

Werner

unread,
Mar 5, 2015, 3:54:40 AM3/5/15
to wxpytho...@googlegroups.com
On 3/5/2015 6:02, Bzzzz wrote:
> debian sid
> wx 3.0.2-1+b1
only wxPython Phoenix will run on Python 3, but not that it is still in
development.

http://wxpython.org/Phoenix/docs/html/main.html

See here:
http://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip

objectlistview you should be able to install with pip/pip3 too, the
others you need to check their sites.

Werner

Bzzzz

unread,
Mar 5, 2015, 8:51:43 AM3/5/15
to wxpytho...@googlegroups.com
On Thu, 05 Mar 2015 09:54:36 +0100
Werner <wern...@gmx.ch> wrote:


> only wxPython Phoenix will run on Python 3, but not that it is still
> in development.

Oh, I understand now why the examples weren't complete and that it might
take time to release.

Thanks for the link, I'm gonna install V.3.n.n-dev

Just one more question: I see on this link that pip & setuptools should
be at least in versions 6.0.8 & 12.0.5; as debian has the annoying habit
to use its own versioning, is it ok with stable? (or at least, jessie,
the next stable to come?)


> objectlistview you should be able to install with pip/pip3 too, the
> others you need to check their sites.

Thanks, but I'm now turning myself toward a wx.Grid that should
better suit my needs.

Jean-Yves

Karsten Hilbert

unread,
Mar 5, 2015, 9:02:45 AM3/5/15
to wxpytho...@googlegroups.com
On Thu, Mar 05, 2015 at 02:51:35PM +0100, Bzzzz wrote:

> Just one more question: I see on this link that pip & setuptools should
> be at least in versions 6.0.8 & 12.0.5; as debian has the annoying habit
> to use its own versioning

Whatever you mean by "its own versioning":


python-setuptools:
Installiert: 5.5.1-1
Installationskandidat: 5.5.1-1
Versionstabelle:
12.2-1 0
10 ftp://ftp.de.debian.org/debian/ experimental/main i386 Packages
*** 5.5.1-1 0
990 http://ftp.de.debian.org/debian/ jessie/main i386 Packages
990 ftp://ftp.de.debian.org/debian/ testing/main i386 Packages
50 ftp://ftp.de.debian.org/debian/ unstable/main i386 Packages
100 /var/lib/dpkg/status
0.6.24-1 0
500 http://ftp.de.debian.org/debian/ wheezy/main i386 Packages


python-pip:
Installiert: 1.5.6-5
Installationskandidat: 1.5.6-5
Versionstabelle:
*** 1.5.6-5 0
990 http://ftp.de.debian.org/debian/ jessie/main i386 Packages
990 ftp://ftp.de.debian.org/debian/ testing/main i386 Packages
50 ftp://ftp.de.debian.org/debian/ unstable/main i386 Packages
100 /var/lib/dpkg/status
1.1-3 0
500 http://ftp.de.debian.org/debian/ wheezy/main i386 Packages


Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Bzzzz

unread,
Mar 5, 2015, 9:31:29 AM3/5/15
to wxpytho...@googlegroups.com
I mean the version that appears into dselect or synaptic (that is:
5.5.1-1 ≠ 12.2-1 & 1.5.6-5).
From what you wrote, I see setuptools is ok (≥ 12.0.5), but not pip
(≥ 6.0.8) (?)

BTW, which command did you use to get those results?

JY

Karsten Hilbert

unread,
Mar 5, 2015, 9:33:05 AM3/5/15
to wxpytho...@googlegroups.com
On Thu, Mar 05, 2015 at 03:31:18PM +0100, Bzzzz wrote:

> BTW, which command did you use to get those results?

apt-cache policy <package>

Bzzzz

unread,
Mar 5, 2015, 9:38:22 AM3/5/15
to wxpytho...@googlegroups.com
On Thu, 5 Mar 2015 15:33:00 +0100
Karsten Hilbert <Karsten...@gmx.net> wrote:

> apt-cache policy <package>

Thanks Karsten.

JY

Bzzzz

unread,
Mar 5, 2015, 10:42:15 AM3/5/15
to wxpytho...@googlegroups.com
On Thu, 05 Mar 2015 09:54:36 +0100
Werner <wern...@gmx.ch> wrote:


> http://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip

Following your link and Karsten information, I purged python-pip &
python-setuptools, then used get-pip.py to manually install both
from the latest version.

Unfortunately, it failed with cryptic messages:

Command
'"/usr/bin/python" /tmp/pip-build-9eJjQO/wxPython-Phoenix/bin/waf-1.7.15-p1
--wx_config=/tmp/pip-build-9eJjQO/wxPython-Phoenix/build/wxbld/wx-config
--python="/usr/bin/python" --out=build/waf/2.7 configure build '
failed with exit code 1. Finished command: build_py (8m24.239s)
Finished command: build (16m0.579s)
WARNING: Building this way assumes that all generated files have been

generated already. If that is not the case then use build.py
directly
to generate the source and perform the build stage. You can use

--skip-build with the bdist_* or install commands to avoid this

message and the wxWidgets and Phoenix build steps in the future.



/usr/bin/python -u build.py build

Command '/usr/bin/python -u build.py build' failed with exit code 1.

----------------------------------------
Command "/usr/bin/python -c "import setuptools,
tokenize;__file__='/tmp/pip-build-9eJjQO/wxPython-Phoenix/setup.py';exec(compile(getattr(tokenize,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record /tmp/pip-5mkUqE-record/install-record.txt
--single-version-externally-managed --compile" failed with error
code 1 in /tmp/pip-build-9eJjQO/wxPython-Phoenix


In /tmp I just have: pip_build_root that contains a placeholder; so I'm
a bit lost at this point. (I did not purged wx2.8 pkgs, may be it is
the problem (?))

Can you help me to solve that?

JY

Werner

unread,
Mar 5, 2015, 11:19:34 AM3/5/15
to wxpytho...@googlegroups.com
Hi,

On 3/5/2015 16:42, Bzzzz wrote:
> On Thu, 05 Mar 2015 09:54:36 +0100
> Werner <wern...@gmx.ch> wrote:
>
>
>> http://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip
Did you install the requirements listed on the above page?

If you did then some Linux guru will have to help.

Werner

Bzzzz

unread,
Mar 5, 2015, 11:31:35 AM3/5/15
to wxpytho...@googlegroups.com
On Thu, 05 Mar 2015 17:19:29 +0100
Werner <wern...@gmx.ch> wrote:

> >> http://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip
> Did you install the requirements listed on the above page?

Yep, I followed this howto literally.

> If you did then some Linux guru will have to help.

Arrgghhh! (I feel like murdering a cute kitten with a rusty chainsaw;)

Hmm, first, I made a mistake, using pip & setuptools from pkgs, they were
a lot more verbose; is there a way to make the tarball pip report many
more and keep the wx3.n-dev tarball files into /tmp/pipxxx to try to
analyse what is wrong?

JY

c.b...@posteo.jp

unread,
Mar 5, 2015, 3:14:53 PM3/5/15
to wxpytho...@googlegroups.com
On 2015-03-05 06:02 Bzzzz <lazy...@gmx.com> wrote:
> debian sid
> wx 3.0.2-1+b1
> =====================

I work on Ubuntu.
Please keep in mind that you have to use the Python3 specific tools for
that.

So don't user "pip" - use "pip3".
Use "python3" not "python" to run any build/install/setup script.

Robin Dunn

unread,
Mar 6, 2015, 8:27:32 PM3/6/15
to wxpytho...@googlegroups.com
Bzzzz wrote:
> On Thu, 05 Mar 2015 17:19:29 +0100
> Werner<wern...@gmx.ch> wrote:
>
>>>> http://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip
>> Did you install the requirements listed on the above page?
>
> Yep, I followed this howto literally.
>
>> If you did then some Linux guru will have to help.
>
> Arrgghhh! (I feel like murdering a cute kitten with a rusty chainsaw;)
>
> Hmm, first, I made a mistake, using pip& setuptools from pkgs, they were
> a lot more verbose; is there a way to make the tarball pip report many
> more and keep the wx3.n-dev tarball files into /tmp/pipxxx to try to
> analyse what is wrong?

I always recommend that when working with Phoenix that people use
virtualenv or pyvenv to make a clean and empty Python environment. Then
you can install things like the latest pip and setuptools without worry
that you may upset the system installed Python. Then you just need to
activate that environment and make sure that the Python and other tools
you run are coming from the venv's bin folder.

As for the build problems, I would have expected that there would be
more output than that, but maybe pip is capturing or suppressing it.
Either way it would be good to try building it yourself so you can take
smaller steps and maybe get more clues about where the problem may be.
If you download the source tarball then you can either use standard
setup.py commands, or you can use the build.py tool to break up the
build process even more. If you use git to fetch the source then you'll
need to use build.py and have it also run the steps that generate the
code. There are some how-to details in the README file and also some
recent conversations on wxPython-dev.

Keep in mind that the build tools will also build wxWidgets by default,
as this is the best way to ensure that the correct version is being
used. That may change once there are official releases, but for now
your wxPython-Phoenix build will have its own private copy of the
wxWidgets libs. This is also a possible point of failure if you do not
have required -dev packages installed, so watch the output when it runs
wxWidgets' configure script to see if it is turning features off that
you don't expect it to.


--
Robin Dunn
Software Craftsman
http://wxPython.org
Reply all
Reply to author
Forward
0 new messages