pip install wheel on windows when multiple python versions - python

I am running python3 on windows, and have 2 python3 versions installed (3.4 and 3.5). This is necessary from some reasons. Python 3.4 seems to be the default one and is located in c:/python34/... while 3.5 is located in c:/Users/u/AppData/...
When trying to do:
pip install C:\Users\YOANN\Downloads\numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
or
pip3 install C:\Users\YOANN\Downloads\numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
I receive the error:
numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
I'm pretty sure it's because it is trying to install it on the 3.4 version instead of 3.5 hence the version mismatch, but I can't find a workaround...
Any idea?

Just run it with the full path to pip and it should work.
c:\Users\u\AppData\Local\Programs\Python\Python35-64\Scripts\pip.exe install C:\Users\YOANN\Downloads\numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
Check the first part, the c:\Users\u should be where you have installed your python3.5
I'm not sure what you are trying to do, but Virtual Environments may be your best friend.

Related

Installing NLTK in Python 2.7 when it already exists in Python 3

I am trying to install NLTK package in Python 2.7 - I already have it installed in Python 3. So every time I run :
sudo pip install nltk
I get:
Requirement already satisfied: nltk in
/anaconda/lib/python3.6/site-packages
Requirement already satisfied: six in
/anaconda/lib/python3.6/site-packages (from nltk)
How do i specifically install nltk in python 2.7 instead?
Thanks a lot!
Jay
The easiest way for install the nltk module with Python 2.7 version is this one:
sudo pip2 install nltk
It will automatically recognize your Python 2.7 version. But you can also be more specific if you have more than one version for Python 2. In that case you could change pip2 to pip2.7. In general the PIP command from version 1.5 supports the pipVERSION argument (see below some examples for different versions of Python environment):
$ pip2.6 install SomePackage # Python 2.6
$ pip2.7 install SomePackage # Python 2.7
$ pip3.6 install SomePackage # Python 3.6
How to solve the sudo:pip2 command not found
(IMPORTANT: be sure of have the correct version of Python 2.7 installed. If you are not sure, please just download it from : https://www.python.org/download/releases/2.7/. For example if you are on Mac machine you need for sure to download it again cause the default version already installed doesn't work properly sometimes with NLTK module).
As the user #kittcar encountered this kind of error I'll show a couple of solutions for find a way around the problem:
The first option is to type on command line: easy_install pip
This will automatically install all the dependencies for your current Python versions. (See the picture below)
IMPORTANT: If you don't have the easy_install command just run:
curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python
The second option (if for some reasons the first option doesn't work) is to type:
curl -O https://bootstrap.pypa.io/get-pip.py and
python27 get-pip.py
Basically you take the source from the target url and then you install PIP for Python 2.7 version.
The third option is to use the conda instead of pip command if you use (like in my personal case) the Anaconda Environment and you want to install the nltk module fastly. In that case you just need to follow these steps:
Download the zip source: https://gist.github.com/danielfrg/d17ffffe0dc8ed56712a0470169ff546.
Extract the folder and rename as "nltk-with-data".
Change directory to one directory above the nltk-with-data directory with cd command.
Run conda build for different Python versions that you need, selecting the packages for the platform and OS you are running the command on.
Below the command list:
conda build nltk-with-data --python 2.7 # you need this one! :-)
conda build nltk-with-data --python 3.4
conda build nltk-with-data --python 3.5
conda build nltk-with-data --python 3.6
Finally you just need to run conda install nltk-with-data and ipython for conclude the nltk installation. And then you just need to type:
import nltk.corpus
nltk.corpus.treebank
As you can see from my screenshot everything went fine and I have successfully installed the nltk module for Python 2.7 with the Anaconda Environment:
Feel free to ask me everything, in particular let me know if you successfully fixed your problem or not. If not, please update your question with command line error logs and your current machine details. So I can understand better what exactly causes your problem and I can suggest you the worth solution for solve it.
Unfortunately, the solutions given in the 2 answers posted above did not work for me. Both pip and pip2 were installing the same new version of nltk that was not compatible with python2.7. Thankfully, the accepted answer of another question, Install older (but stable) NLTK version compatible with python 2, solved the problem. The solution is to specify explicitly the version of nltk to be installed when using the pip command:
pip install nltk==3.4.5
Versions of nltk higher than 3.4.5 happen to be incompatible with Python 2
you should use different pip for python 2 and 3. Or just virtual env.
Anyway, another possible idea to Giulio Bambini's response is:
python2.7 -m pip install <module>
with
sudo
if necessary

getting python pyobcd installed

I'm a little lost on how to get pyodbc installed in my computer.
I have python 3.6.1
The link
http://support.esri.com/en/technical-article/000011656
pointed me to another link
https://github.com/mkleehammer/pyodbc
Which is vague.
I'm used to downloading and running an exe for install.
This link is unclear and says all I have to do is:
"pip install pyodbc"
What exactly do I need to do to get this working?
Since you have not mentioned which OS you are using,
I will assume that you are on windows (as you have mentioned that you are used to install using .exe).
Firstly you need to know what a pip is:
pip is basically a package manager for python packages used to install 3 rd party packages which do not bundle along with the python distribution.
On linux pip comes pre installed also if you are using python version 3.4 onwards or python 2.7.9 you will be having pip pre installed on your system.
All you have to do it to open the command prompt issue the command
pip install package-name(pyobdc here)
it will do the job.
If you do not find pip in your distribution you can refer this link
How do I install pip on Windows?
open cmd in your computer and type
pip install pyobdc
Hello there and welcome to python programming. Basically python comes with its package installer so either you can go to any interpreter that you are using and type pip install pyobdc or use the command prompt in windows and type in pip install pyobdc. This would install your module and just remember to put import pyobdc at the top of the code if you want to use this package. Further information can be found on here

Does the python.org installer of python come with pip, and how do I use it?

I can download python 2.7.12 from python.org, and all python versions from 2.7.9 onwards are supposed to come with pip, but after installing it, using pip in the terminal does not work.
I am on macOS.
Have I installed pip, and if I have, how do I use it?
Here you have informations about pip:
https://packaging.python.org/installing/
normally python from python.org come with pip, maybe you should just update...
to update from terminal:
pip install -U pip setuptools
After when you need to install package, for example numpy, just do in a terminal:
pip install numpy
more informations here :
https://pip.pypa.io/en/stable/reference/pip_install/
you can also use conda install from anaconda as an alternative of pip :
http://conda.pydata.org/docs/get-started.html
Multiple instances of Python can coexist on your machine. Thus you could have installed Python 2.7.12 yet, when you call Python from terminal, you may be calling an older version.
To know which version you are using, type which python in terminal and look at its path. Then from Python in terminal, type
import sys
print(sys.version)
to get the exact version.
As Dadep says, I would recommend using conda to isolate your invironments if you have to play with multiple Python interpreters. Further conda simplifies 3rd party package installation process beyond doubt.

Python 2.7.11 pip not installed

I have Python 2.7.11 installed on my machine which to my understanding should come with pip, however when I check the C:\Python27\Tools\Scripts\ directory there is no pip.exe present.
I have tried completely removing and reinstalling Python 2.7.11 without success. Running the installer pip is set to be installed, but after the install pip is nowhere to be found.
I also have Python 3.4 installed which has pip as expected. Any thoughts?
I encountered the same problem - pip not installed - with python-2.7.16, Win10, installing for 'all users'. It was resolved when I allowed the MSI installer to target the default location (C:\Python27) rather than changing it to under Program Files (x86). I've no clue why this changed anything.
python2.7.11 should install pip into c:\python27\scripts, you can take a look here
I used https://pip.pypa.io/en/stable/installing/ to make it install. Odd that an outside body has to make a tool to get pip to install. There is no mention of pip.pypa.io on the Python web site.
Although I got error messages, it did install, so check carefully.
You also may see a message suggesting that you upgrade to pip 9.0 with the command 'pip install --upgrade.' I highly recommend that.
Also, make sure you are in the directory where pip.exe is located when you run the commands. They don't tell you that, because they assume you know that, but we're not all geeks.
For people who are running into this issue, I have a Windows 10 x86 dev box that I use for exploit development, Python 2.7 was installed due to Immunity Debugger, this install did not include the new SSL package and did not include "pip".
There was no "C:\Python27\Scripts" folder which included pip. I did have a "C:\Python27\Tools\Scripts" folder which did not have pip installed.
I tired to install pip as suggested but did not work. Best way is to uninstall Python and install newest version, currently mine is 2.7.15 which came with pip as an option. This is what solved my issue, any older version of Python will need upgraded to support the SSL packages. You will receive the same errors when you try to install pip on an older version.
If you have reinstalled Python which included the SSL package and it still does not have pip, trying installing pip this way:
1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
2. python get-pip.py
https://pip.pypa.io/en/stable/installing/
This should work if you have a newer version of Python.
Once you have installed pip or newer version of python, go to "C:\Python27\Scripts" and you should see pip.exe.
I have installed "python-2.7.16" in my windows 10 PC. PIP is installed under "C:\Python27\Scripts". One can add the "C:\Python27\Scripts" path to environment variable and then access pip command from command prompt.
To add the path in environment variable:
Control Panel\System and Security\System --> Advanced System Settings --> Advanced --> enviroment variables --> under system variable --> Path(variable name)
Had the issue where no matter which version of python 2.7 I installed on windows 10 there was no pip.exe generated in the "Scripts" folder.
I solved it by ensuring that that MSI Installer file had Admin privileges before installing
if pip is not installed you can use easy_install.exe to install pip and other modules
you can find easy install in
python -m easy_install pip
I had the same issue:
Installed Python 27
Tried to use pip, but failed with unrecognized command error
Checked installation: no "C:\Python27\Scripts", only "C:\Python27\Tools\Scripts"
This issue happens only on some versions of Windows.
HOW TO FIX IT:
Uninstall Python 27
Reinstall Python 27, but unselect "pip" feature
Check installation: no "C:\Python27\Scripts" as expected
Start the installer again and use "Change Python"
Set "pip" and "Add Python.exe to Path" features to be installed
Check installation: "C:\Python27\Scripts" is now correctly present
So for some unknown reason, pip is not correctly installed on some versions of Windows if it is installed during default Python 27 setup. To fix this issue, pip must be installed afterwards using the "Change Python" setup.
I meet the same issue when install Python 2.7.9. The installer does not come with pip.
Solution:
Install newer python2 x86 version: https://www.python.org/downloads/release/python-2718/
Then pip is located at C:\Python27\Scripts\pip.exe
It happens on windows as you should have admin rights to install anything on disk C.
I have the same issue Scripts folder was not installed. I would sugest to instal it on disk D.

Installing rpy2

I'm running Python 3.5 with Anaconda on Windows 7 and i want to use rpy2. I already have R 3.3 installed which works perfectly well in RStudio.
pip install rpy2
Returned
"Tried to guess R's HOME but no R command in the PATH"
I followed a solution proposed here and downloaded rpy2 2.8 and then
cd Downloads
pip install rpy2-2.8.0+r33-cp35-cp35m-win32.whl
which seemed to work (returning "Successfully installed rpy2-2.8.0").
However,
import rpy2
in Spyder returns
"No module named 'rpy2'"
Please help, I'm lost...
If you're desperate, you could install WinPython (for windows users) which has a lot of Packages already installed and ready to use, including rpy2, sometimes installing packages on windows can be stressful.
Or if you really want to make it work that way, maybe you could check if that package was installed in the Downloads folder and move it to the folder corresponding to python libraries
I think you has more than one installed python?!
If so, then "pip .. install .." installs the library into this python which you get when you type "python" in a shell/console.
If you want to install this 32Bit library with the 32Bit version of your python 3.5 you can type "py -3.5-32 -m pip .. install .."
"py -3.5-32" choose your 32Bit Python 3.5 interpreter (from your registry?)
"-m pip" loads the module pip.
The rest of the pip command is the same like before, something with install ... packagename ..

Categories