Installing packages in Python 2.7.9 [duplicate] - python

This question already has answers here:
error: Unable to find vcvarsall.bat
(42 answers)
Closed 8 years ago.
I'm brushing up on my Python and have recently installed ver. 2.7.9 on my Win7 64-bit PC. I tried installing a couple of packages (numpy 1.9.1 and scipy 0.15.1) but I get errors through the process. I ran:
> python setup.py install
from the folder of each package and although the setup script ran, neither of the packages got installed. I got the following errors:
numpy: Unable to find vsvarsall.bat
scipy: No module named numpy.distutils.core (???)
Note that I haven't tampered with the packages files at all, which I extracted from the .tar files available in the Python Package Index database. I'd appreciate any help on this matter.

The go-to repository for Windows modules is Christoph Gohlke's Python Extension Packages for Windows site. He has both numpy and scipy available. To install, download the appropriate .whl file, then run
pip install name_of_file.whl
to install the module. pip should have been installed automatically when you installed 2.7.9, if the command is not found, make sure you add C:\Python27\Scripts to your PATH and restart the command prompt.

Related

"Cannot open include file: 'gsl/gsl_errno.h': No such file or directory" error on Widnows 10

I am trying to install a python package pyphenomd in anaconda on my Windows 10. I have installed Microsoft Visual C++ 2015 and the GNU Scientific Library (GSL) package using conda.
I then tried installing pyphenomd using in the Anaconda Prompt
pip install pyphenomd
(Not using conda install since that gives a Packages Not Found Error.)
But I keep getting the following error.
Then
Installing collected packages: pyphenomd
Running setup.py install for pyphenomd ... error
Followed by another iteration of the above error. Finally ending with this message
Based on Cannot open include file: 'gsl/gsl_errno.h': No such file or directory message I am assuming the error is Visual C++ is not able to access the header files for gsl. I then reinstalled the gsl package from conda but that didn't help. So then I installed GSL using vcpkg following the procedure mentioned in here. This did not help either and I am still getting the same error. Installing GSL via cygwin also didn't help.
Now I don't know what to do. I am not even sure if the error is with the installation of gsl ?
Other similar questions that I found either didn't have any answers or the provided solutions weren't relevant.

How do I install matplotlib on pyCharm [duplicate]

This question already has answers here:
Can't install matplotlib to pycharm
(3 answers)
Closed 2 years ago.
I'm new to python and I'm using PyCharm as my IDE. I've been able to successfully install other packages like numpy, pandas etc. However, when I'm installing matplotlib, I keep getting the error:
src/checkdep_freetype2.c(5): fatal error C1189: #error: "FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it."
I installed it through the command prompt and it installed correctly but (I believe) PyCharm creates it's own environment and does not recognize packages installed through command prompt even though I tried to install them in the same path as other packages in PyCharm. Can you please help?
I had to run the command "pip install updates" and after that I could install the matplotlib package. It turns out that my pip wasn't of the latest version.

Install Python module paramiko on windows

I have been trying to install paramiko module on windows without success. I have been getting errors related to Visual C++ compiler missing. Is it possible to install paramiko without having to go through compile process.
Based on the method from this question this is what I would suggest (assuming you already have >=python-2.7.9 installed, if not, upgrade, 2.7.9 comes with pip, pre 2.7.9 doesn't):
Get the appropriate pycrypto whl file (based on python version and win32/win_amd64). I've found some available here (can't vouch for the site as I don't use python on windows much).
Run pip install pycrypto-stuff.whl (in a command prompt window in the directory where you've saved the pycrypto whl file).
Run pip install paramiko (in a command prompt, but can be in w/e folder you like).
That should do the trick. In general a simple pip install package_name would work, but pycrypto does not provide a wheel file (binary package), therefore you have to build it. By the sound of it you don't have Visual C++ installed (or not the right version, it only works for one, I don't recall which), pycrypto needs an extension package built to use the system crypto libraries, which is why the source package isn't working.
I was able to get it working by installing the following packages using pip.
pip install bcrypt cryptography pynacl paramiko
These were the packages my Linux install used as prerequisites, so they should work on windows as well.

Installing Pocketsphinx with pip on Windows 7

I'm trying to install pocketsphinx on Windows 7 for Python 2.7. I found this https://github.com/bambocher/pocketsphinx-python, installed the dependencies, ran pip install pocketsphinx, which resulted in the "Successfully installed pocketsphinx-0.0.5" message, but when I attempt to run python file which contains import pocketsphinx I get an import error, "no module named pocketsphinx." Any idea what the problem could be?
Windows Solution
Christoph Gohlke kindly added a compiled version of pocketsphinx to his unofficial extension library.
If you are running Python 2.7 (32-bit) then download: "pocketsphinx-0.0.9-cp27-cp27m-win32.whl"
Here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx
Then run: pip install "pocketsphinx-0.0.9-cp27-cp27m-win32.whl"
The location you found is not well supported and has bugs. This particular one does not properly install __init__.py, that's why you can not load the module. I suggest you to build the official one instead, it should work:
http://github.com/cmusphinx/pocketsphinx-python

How to install the module pysqlite2 [duplicate]

This question already has answers here:
error: Unable to find vcvarsall.bat
(42 answers)
Closed 8 years ago.
I want to install the PySqlite2 module in my python library. I opened command prompt and went to the download directory. This contains the Pysqlite-2.6.3 package extracted. I entered python setup.py install. It starts copying all the files untill it gives: Errror: Unable to find vcvarsall.bat. I can't seem to figure to out. My systems runs a 32bit version of windows 7.
While running setup.py for package installations Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use a newer Visual Studio by setting the correct path in VS90COMNTOOLS environment variable before calling setup.py.
Find more here.

Categories

Resources