I am trying to install the wxPython 4 on my Ubuntu 18.04 machine.
sudo pip install wxpython
I get this warning first
The directory '/home/user/.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/user/.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.
and eventually error
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-SyaTU1/wxpython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-bzIjlK/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-SyaTU1/wxpython/
I had similar problem with wxPython3 and the solution was to install it with get
sudo apt-get install python-wxgtk-3.0
I also was able to install wxPython 4 for Python 3 but not for Python 2.7 (instructions)
Also, I am very confused why it takes so much CPU to install wxpython
sudo pip install wxpython
After waiting long enough the process was complete and I got wxPython 4 installed.
run
sudo pip install wxpython
orsudo pip3 install wxpython
wait for a while for it to install
after completion, you will see this message.
Since there are various options for distro and wx port (GTK2 or GTK3) then the files can not all be located in the same folder for easy access by pip. This simply just means that you'll need to drill down a little further to find the URL to give to pip. For example, to get the GTK3 wxPython builds for Ubuntu 18.04 (and 16.10, LinuxMint 18, and probably others) you can use a pip command like this:
pip install -U \ -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \ wxPython
Of course you can always download the wheel file yourself and then use pip to install your local copy of the file.
First I found it by:
I installed the latest wxpython with:
You may also try synaptic to install it that way if you prefer.
if any one revised this error
try this