Error: Failed building wheel for wxpython-phoenix while installing wx - python

I am trying to install wxpython (I have python 3.5.2(32Bit) and Windows 10(64Bit))
I tried :pip install wx and i get: Failed building wheel for wxpython-phoenix 2 times and then a big error line-->
I also tried installing Anaconda, but it did not help.How can I overcome the problem ?

There's a lot of questions about failed installations on windows, probably because the packages are compiled when installed, and sometimes the compilation fail when the compiler is not properly configured. I admit I decided to let the specialized people handle it.
As a nice workaround, you can grab the already built distribution at the official wxpython website located here:
Python 3.5 32/64 bit windows:
https://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev2700+c524ed1-cp35-cp35m-win_amd64.whl
https://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev2700+c524ed1-cp35-cp35m-win32.whl
just download the .whl file and do for example:
C:\python35\scripts\pip install wxPython_Phoenix-3.0.3.dev2700+c524ed1-cp35-cp35m-win_amd64.whl

For linux you need to go here first
https://extras.wxpython.org/wxPython4/extras/linux/gtk3/
Then grab your linux version and do the install.
(base) fsdfsdfd#linux:~/Downloads$ pip install wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
Processing ./wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
Requirement already satisfied: pillow in /home/orangel/miniconda3/lib/python3.8/site-packages (from wxPython==4.1.1) (8.1.2)
Requirement already satisfied: numpy; python_version >= "3.0" in /home/orangel/miniconda3/lib/python3.8/site-packages (from wxPython==4.1.1) (1.20.1)
Requirement already satisfied: six in /home/orangel/miniconda3/lib/python3.8/site-packages (from wxPython==4.1.1) (1.15.0)
Installing collected packages: wxPython
Successfully installed wxPython-4.1.1
if does not works, please try this
sudo apt install libwxgtk3.0-gtk3-dev

Related

How do I install tables module to run?

I am trying to run some code written by a collaborator in Python 2 which requires the tables module. I have checked that tables is installed by importing it successfully in a Python 3 shell at the command line but when I do the same for Python 2, there is no module named tables.
All answers I have found so far don't seem to solve my issue, any ideas?
Cheers :)
Try download the package with
pip install tables==3.5.2 -- Python 2
Also, follow this issue on GitHub regarding this at #772
It's not recommended to use python2 as the end of its life on January
1st, 2020, Please consider visiting this documentation Migrating
from PyTables 2.x to 3.x
Use Command - pip install tables
C:\Python27\Scripts>pip.exe install tables
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting tables
Downloading https://files.pythonhosted.org/packages/84/86/34604cfd8e79d23ffef7f1c0ab134ddb98da572d0fcb9cb4631d5b47f549/tables-3.5.2-cp27-cp27m-win_amd64.whl (3.5MB)
|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| 3.5MB 787kB/s
Collecting numexpr>=2.6.2
Downloading https://files.pythonhosted.org/packages/45/d3/5997f8c7d48d4947665c7e7dfaabc3076da85390faf015288e39f242d520/numexpr-2.7.0-cp27-none-win_amd64.whl (106kB)
|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| 112kB 3.4MB/s
Requirement already satisfied: six>=1.9.0 in c:\python27\lib\site-packages (from tables) (1.12.0)
Requirement already satisfied: numpy>=1.9.3 in c:\python27\lib\site-packages (from tables) (1.16.5)
Collecting mock>=2.0
Downloading https://files.pythonhosted.org/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
Collecting funcsigs>=1; python_version < "3.3"
Downloading https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
Installing collected packages: numexpr, funcsigs, mock, tables
WARNING: The scripts pt2to3.exe, ptdump.exe, ptrepack.exe and pttree.exe are installed in 'c:\python27\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed funcsigs-1.0.2 mock-3.0.5 numexpr-2.7.0 tables-3.5.2
C:\Python27\Scripts>

why is the pip install process stuck on ''Installing collected packages" step?

I'm trying to pip install some python libraries in a virtual environment created by conda create, but for some packages, the installation were stuck on the step "Installing collected packages: .
Take pandas as an example:
My command and output are as follows:
pip install pandas --no-cache-dir
Collecting pandas
Downloading https://files.pythonhosted.org/packages/99/12/bf4c58eea94cea4f91ff931f284146337814fb8546e6eb0b52584446fd52/pandas-0.24.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (16.3MB)
100% |████████████████████████████████| 16.3MB 11.4MB/s
Requirement already satisfied: numpy>=1.12.0 in /anaconda/envs/testctds2/lib/python3.6/site-packages (from pandas) (1.16.1)
Requirement already satisfied: pytz>=2011k in /anaconda/envs/testctds2/lib/python3.6/site-packages (from pandas) (2018.9)
Requirement already satisfied: python-dateutil>=2.5.0 in /anaconda/envs/testctds2/lib/python3.6/site-packages (from pandas) (2.8.0)
Requirement already satisfied: six>=1.5 in /anaconda/envs/testctds2/lib/python3.6/site-packages (from python-dateutil>=2.5.0->pandas) (1.12.0)
Installing collected packages: pandas
The process just hang there (at least for 30 min) until I control+z to quit (control+c got no response).
What I have tried:
conda install pandas worked well, which is also the recommended way to install pandas. I just don't understand why pip install didn't work, as it's assumed to and this situation also happened to some other libraries such as numpy, scipy, and scikit-learn.
I also tried without --no-cache-dir or -vvv to see more details, but in either case there were no more information or error code after the line "Installing collected packages: pandas"
I tried the command in a new terminal window. Magically numpy can be installed very quickly by "pip install numpy", but it didn't work with pandas or scipy.
I see this may be a problem other users are having. Here is a github link describing the same problem. There are a few others on the Conda GitHub page. Some of the answers that come from that post are:
Make sure you are up to date on your root conda environment. try: conda upgrade conda
Create a brand new virtual env
Micheal Grant, who is a Director for Technical Consulting at Anaconda replied to that thread with this:
That said, when I look at the debug output, I'm finding that it's not able to prune back the package list very well. The more "old" packages it has to consider the higher the likelihood that this kind of solver stall happens. Thankfully it is a lot less likely than it used to be.

Why does pybrain 0.3.1 install instead of 0.3.3?

I'm having trouble installing the proper version of PyBrain. This is a problem.
(rnine) ronaldo#ronaldo-laptop:~$ pip install https://github.com/pybrain/pybrain/archive/0.3.3.zip
Collecting https://github.com/pybrain/pybrain/archive/0.3.3.zip
Downloading https://github.com/pybrain/pybrain/archive/0.3.3.zip
\ 1.5MB 1.4MB/s
Requirement already satisfied: scipy in ./.conda/envs/rnine/lib/python3.5/site-packages (from PyBrain==0.3.1)
Installing collected packages: PyBrain
Running setup.py install for PyBrain ... done
Successfully installed PyBrain-0.3.1
As you can see, it keeps installing PyBrain 0.3.1 even though I'm pulling in the 0.3.3 folder. Why is this happening and how can I fix this.
Download this package and see its setup.py, you will see version="0.3.1", so this is a bug made by author.
You have nothing to do with it except for modifying source code by yourself.

installing tweepy on Mac using pip - error message

I have recently switched laptops from Microsoft to Apple (2015 MacBook Pro) and I have been installing python libraries such as Nlkt succesfully without any issues.
Now I have been trying to install tweepy and seem to get loads of different error messages.
After trying I pip install tweepy[error message saying "invalid syntax" in my terminal] I did some research on here and tried the below solution:
import pip
>>> package_name='tweepy'
>>> pip.main(['install',package_name])
OSError: [Errno 1] Operation not permitted: '/var/folders/t1/4g62trws5812jb97vvw5kp900000gn/T/pip-yabtGc-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
2
>>>
As you can see it is still not working...
I have also tried sudo pip install tweepy, which came up with this message:
The directory '/Users/MYNAME/Library/Caches/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.
Requirement already satisfied: tweepy in ./Library/Python/2.7/lib/python/site-packages
Requirement already satisfied: six>=1.7.3 in ./Library/Python/2.7/lib/python/site-packages (from tweepy)
Requirement already satisfied: requests-oauthlib>=0.4.1 in ./Library/Python/2.7/lib/python/site-packages (from tweepy)
Requirement already satisfied: requests>=2.4.3 in ./Library/Python/2.7/lib/python/site-packages (from tweepy)
Requirement already satisfied: oauthlib>=0.6.2 in ./Library/Python/2.7/lib/python/site-packages (from requests-oauthlib>=0.4.1->tweepy)
Requirement already satisfied: urllib3<1.22,>=1.21.1 in ./Library/Python/2.7/lib/python/site-packages (from requests>=2.4.3->tweepy)
Requirement already satisfied: idna<2.6,>=2.5 in ./Library/Python/2.7/lib/python/site-packages (from requests>=2.4.3->tweepy)
Requirement already satisfied: certifi>=2017.4.17 in ./Library/Python/2.7/lib/python/site-packages (from requests>=2.4.3->tweepy)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./Library/Python/2.7/lib/python/site-packages (from requests>=2.4.3->tweepy)
When I tried to import tweepy into idle it said "no module named tweepy"
Sorry for my longwinded explanation but I'm getting desperate...
Thank you very much for your help already!!
One solution is to use virtualenv.
In short, virtualenv creates a separate python instance in a folder different from the computers' python installation. This allows for easy installation of packages and helps you manage dependencies better than installing everything globally with pip.
How do I do this?
First, install virtualenv
$ pip install virtualenv
Next, create a virtual environment. The following command will create a python instance in a folder named "foo" in the directory you execute this from.
$ virtualenv foo
Now, whenever you need to install something, use the pip that is located at foo/bin/pip and the python located at foo/bin/python.
$ foo/bin/pip install tweepy
You can test this via the python interpreter:
$ foo/bin/python
Python 2.7.10 (default, Feb 6 2017, 23:53:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tweepy
Why would you want to do this?
If you use virtualenv, you are less likely to run into dependency issues.
For example, lets say you make some python program, called ProjectAAA, which uses version 1.1 of LibraryXYZ. A couple months later you want to write a new, completely unrelated python program, ProjectZZZ, which uses version 2.2.5 of that same library. When LibraryXYZ upgraded from 1.1 to 2.2.5, they removed and renamed a few classes and functions that you used in ProjectAAA. So, if you used pip and installed to the main python instance on your Mac, you won't be able to run ProjectAAA anymore, because it depends on version 1.1 but your computer has version 2.2.5.
If you used virtualenv, you could have two separate python instances, each with their own pip and their own package installations. So the environment for ProjectAAA has version 1.1, the environment for ProjectZZZ has version 2.2.5, and both can live peacefully on your computer.
I use OS X and I just successfully installed tweepy on Python IDLE using:
import pip
package_name='tweepy'
pip.main(['install',package_name])
It was pretty easy.
Thanks for the provision; now I can get on with my first extraction.
From looking at your error message, it appears you already have it.
Requirement already satisfied: tweepy in ./Library/Python/2.7/lib/python/site-packages
I tried replicating your issue (in both Python 2.7/3.5) and didn't run in to any issues and was able to import it in to IDLE.
A potential solution could be changing your PATH directory to the one that's listed in your error message.
export PYTHONPATH=$PYTHONPATH:./Library/Python/2.7/lib/python/site-packages
Another thing would be to consider using a virtual environment in the future to ensure that there is no conflict in your package installations.
Further notes: Installing Python on Mac OS X: virtualenv

Installing Fuel (Machine Learning) using pip on Ubuntu 14.04.02

When installing the Fuel machine learning library, I got stuck with some dependencies issues:
alvas#ubi:~$ pip install --upgrade git+git://github.com/mila-udem/fuel.gitYou are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting git+git://github.com/mila-udem/fuel.git
Cloning git://github.com/mila-udem/fuel.git to /tmp/pip-xUlqCT-build
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting numpy (from fuel==0.0.1)
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from fuel==0.0.1)
Collecting picklable-itertools (from fuel==0.0.1)
Downloading picklable-itertools-0.1.1.tar.gz
Collecting pyyaml (from fuel==0.0.1)
Downloading PyYAML-3.11.tar.gz (248kB)
100% |████████████████████████████████| 249kB 612kB/s
Collecting h5py (from fuel==0.0.1)
Downloading h5py-2.5.0.tar.gz (684kB)
100% |████████████████████████████████| 688kB 398kB/s
Collecting tables (from fuel==0.0.1)
Downloading tables-3.2.2.tar.gz (7.0MB)
100% |████████████████████████████████| 7.0MB 73kB/s
Complete output from command python setup.py egg_info:
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
* Using Python 2.7.6 (default, Jun 22 2015, 17:58:13)
* USE_PKGCONFIG: True
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wMS1d3/tables
Then after I have done (Installing h5py on an Ubuntu server):
sudo apt-get install libhdf5-dev
sudo HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py
And then I had to also update my cython with:
sudo pip install cython
My question is not about how to fix the installation issues but what does this command mean?
sudo HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py
What does specifying the HDF5_DIR do?
Why didn't the fuel dependencies automatically install from the:
https://github.com/mila-udem/fuel/blob/master/requirements.txt
https://github.com/mila-udem/fuel/blob/master/setup.py
What should I do to update the setup.py from fuel so that it can automatically pip install the dependencies?
You do not need to make any modifications to the setup.py from fuel. Just make sure HDF5_DIR is set correctly before updating the lib.
Explanations:
If you look at your error log, you can see that it fails at installing the h5py python lib that is a dependency of fuel. It also tells you why it failed at the end, basically it is because h5py use the C library hdf5 and it needs the headers of this lib to use it.
So the sudo apt-get install libhdf5-dev that you executed is to install the development version of this C library (you can gess that by the -dev). The dev versions install the headers of the lib and not just the compiled lib.
Then, the HDF5_DIR env variable is nedded to tell h5py setup where to find those headers.
So if you whant to update the fuel lib next time, make sure that the HDF5_DIR is set correctly and then it will update its dependencies (including h5py).

Categories