2
votes

I would like to install wxPython/4.0.1

On this page all kind of wheel files are shown. I have Ubuntu 14.04 64 bit and Python 3.5 so I assume I should use wxPython-4.0.1-cp35-cp35m-win32.whl but this is not total clear to me. The page lacks a simple full installation instruction.

@nepix32 helped me and shown the Linux version https://wxpython.org/pages/downloads/ and I have been pointing to https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04/

apt-get

My preference is using apt-get, so I search on SO and found : Installing wxpython on ubuntu 14.04 and using travis-ci with wxpython tests which both fails.

So I continue searching on wheel.

Install wheel

So I continue searching on wheel. On SO I found : How do I install a Python package with a .whl file?6 First I read https://stackoverflow.com/tags/python-wheel/info and https://pypi.python.org/pypi/wheel Wheel seems not standard installed, so I downloaded the file wheel-0.30.0 and extracted it.

First I upgraded pip :

sudo pip install --upgrade pip

and then executed the setup.py in wheel :

sudo python3.5 setup.py install

which seems successful.

Try to install wxpython using wheel

Then I wanted to install the wheel file :

sudo pip install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-win32.whl

I thought for python3.x pip3 should be used, instead of pip. All examples show pip. I tried both without success.

I tried also :

sudo -H pip3 install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-win32.whl

All attemps returned almost the same error message :

wxPython-4.0.1-cp35-cp35m-win32.whl is not a supported wheel on this platform.

Using specific Linux version

I used

wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl

but do not know the difference of the 'm' and the 'mu' version. The result is :

    sudo pip install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl wxPython
The directory '/home/hulsman/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/hulsman/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.
hulsman@vbox11:~/Downloads$ 

and with the -H flag :

    hulsman@vbox11:~/Downloads$ sudo -H pip install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl wxPython
wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.
hulsman@vbox11:~

Check my environment

$ pip -V | grep -o "(.*)"

(python 3.4)

Pip points to Python3.4

$ pip3.5 install -i https://localhost  --trusted-host localhost cffi==1.11.4
pip3.5: command not found

pip3.5 does not exist

$ python3.5 -c "import pip; print(pip.pep425tags.get_abbr_imp())"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'pip.pep425tags' has no attribute 'get_abbr_imp'

This fails. So I tried :

$ python3.5 -c "import pip; print(pip.pep425tags.get_abbr_impl())"

cp

So I tried to update pip :

~$ pip install -U pip

Requirement already up-to-date: pip in /usr/local/lib/python3.4/dist-packages

I tried to follow the suggestions in Install pip for python 3.5 of L. Martin, but without success.

with pip3 the behavior is the same.

Could you tell me what when wrong, and how can I solve this?

1
You downloaded a wheel for 32bit windows but you appear to be using Linux. - jordanm
Yes, I was in doubt. I could not find an Linux distribution. Is there a Linux distribution, and if so where can I find it? - Bernard
There are some prebuilt wheels for few Linux distros. Look for the extras/linux download, explained on wxPython/Downloads in section Linux wheels. Essentially you have to download the matching wheel (distro-gtk2/gtk3) and pip install it. - nepix32
@nepix32 Thanks. I followed your answer and executed it. But the results are the same. - Bernard
@Bernard: Think your whole problem was that it was not clear to you in which Python you are actually working. Ubuntu seems to come with 3.4 as default, but somehow you were doing things in a 3.5. So the first thing I do if things go weird is to just check my assumptions: First enter python: Is the version coming up the one you expect? If yes, make pip list. If the packages shown are not the ones you expect, you have a problem. This should work on any properly activated Python environment - nepix32

1 Answers

0
votes

Installing wxPython in Linux is not as straightforward as Windows/OSX wheels because there are too many variants: distro, GTK2/GTK3 etc. But they do explain how to install it in Linux:

https://wxpython.org/pages/downloads/

Installing with a downloaded wheel

You already found the correct wheel (cp35m-linux_x86_64) in wxPython Extras, but you must install it with the targeted Python version. If you can't find pip for your target Python, just use the -m option of Python:

python3.5 -m pip install wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl

Installing the usual way from pypi

The normal pip install method can work too, but for wxPython in Linux, that will try to build the wheel for you from the source archive - assuming you have all the dependencies. It will be inconvenient, and slow.

Again, you must run it with the correct targeted version of Python:

python3.5 -m pip install -U wxpython

Installing directly from wxpython.org wheels (recommended)

The easiest way is to get it directly from them:

python3.5 -m pip install wxPython -U --pre \
  -f  https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04

Or, if you just wanted to download the correct wheel to manually install later, and specifically wanted to target a specific python version, say 3.5:

pip download wxPython \
  -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 \
  --only-binary=:all: \
  --platform linux_x86_64 \
  --abi cp35m \
  --python-version 35 \
  -d "${HOME}/pymodules/wxpython-py35-whl"

Change the distro in the url as needed. Note that the pip version is not important here.

The difference in 'm' and 'mu' is no longer relevant in Python 3. It was related to ucs2/ucs4 unicode build flags. If you were targeting Python 2.7 you would use the abi option to pick the 'mu' version like this: --abi cp27mu

Since pip 19.2 added a new debug command, these kinds of obscure issues may get easier to diagnose. That useless not a supported wheel on this platform message certainly didn't help anyone.