how to install python module for specific python version - python

i have been trying to install module for python-3.6 through pip. i've read these post from stackoverflow and from python website, which seemed promising but they didn't worked for me.
Install a module using pip for specific python version
python website
I've added python3.6 main folder,Scripts and Lib to PATH and i've tried these commands.But somehow they refer to anaconda installations.
C:\Program Files (x86)\Python36-32\Scripts> pip3 install xlrd
C:\Program Files (x86)\Python36-32\Scripts> pip install xlrd
C:\Program Files (x86)\Python36-32\Scripts> pip3.6 install xlrd
C:\Program Files (x86)\Python36-32\Scripts> py -3.6 -m pip install xlrd
C:\Program Files (x86)\Python36-32\Scripts> py -3 -m pip install xlrd
but they give same answer.
Requirement already satisfied: xlrd in c:\programdata\anaconda3\lib\site-packages (1.1.0)

to install package for a specific python installation, you need a package installer shipped with that installation, in your case, pip is installed by an anaconda installation, use pip.exe or easy_install.exe from this python3.6 installation's Scripts directory instead.

First, Uninstall all the versions you have!
then go to the library https://www.python.org/downloads/
Select the required vesrsion MSI file. Run as administrator!

i think as my python was 3.6 also my anaconda distribution, So anaconda was automatically taking over all commands. i installed python 3.7 with anaconda 3.6 and it worked fine as it was mentioned in python website

Related

Trouble installing packages in Python - ... is in an unsupported or invalid wheel

Hi I am trying to install win10toast and I get this message:
I had this error when I tried to download pywin32 previously, but why is this error popping up whenever I try to install any other package? I used to be able to install packages fine before with the same command
pywin32 is listed as a requirement for the package win10toast (link). So, when you are installing win10toast, pip also tries to install pywin32 which gives you an error.
From the looks of it, you are using a python 3.6 and a 32-bit system, both of which are supported by the latest release (pywin32 302). To resolve the pywin32 error, you could try the following.
Option 1: Considering there are multiple installs and python3 is mapped to python 3.6 installation. (You can check that using python --version)
Install using python -m pip install pypiwin32
If you had a prior successful install on pypiwin32, you could actually try to use: python Scripts/pywin32_postinstall.py -install
Option 2: Download the binary files and install - https://github.com/mhammond/pywin32/releases/tag/b302
Download the appropriate exe and install
Option 3: Download the source files and build:
Download the zip file from: https://github.com/mhammond/pywin32/releases/tag/b302
Unzip the file
Use the command python setup.py install
Update:
I was looking around the pywin32 github repo and found that the same issue is encountered by others too. While an official update is not rolled out, you can try the solution there:
you need to download the wheel found here
Install the whl manually using the command: python -m pip install C:/some-dir/pywin32-302.1-cp36-cp36m-win32.whl

ERROR: You must give at least one requirement to install - CDSW

I am trying to install packages on my cdsw environment.
I have placed the packages in my cd /home/ folder
and I am running below command:
pip install --no-index --find-links=/home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
I get below error:
ERROR: You must give at least one requirement to install (maybe you meant "pip install /home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl"?)
Linux version:
4.4
Python 2: Python 2.7.11
Python 3: Python 3.6.1
Java: openjdk version "1.8.0_211"
How do I resolve this problem.
Currently, you are only passing information to pip of where you want to find the package but not what package to install. find-links is used to pass a location of where your package will be located (and not the package).
To successfully installl you can use:
pip install --no-index /home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Edit 1:
Based on your comments, you also do not have the whl downloaded. So, you can also simply install scipy using the command:
pip install scipy
or can download a specific whl file from scipy's github
Edit 2:
Since you still are running into the error, and have 2 python versions installed, the pip command might be associated with python2.7. In that case, it is likely that python3 is the command associated to the python3 installation and python is the command associated to the python2 installation. Using the command in the format below will install scipy correctly.
python3 -m pip install --no-index /home/cdsw/Package/scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Edit 3:
You have python 3.6.1 installed on your machine, which is not supported by scipy v1.7.1. You have 2 options to fix this issue:
Upgrade to a newer version of python
Install a version of scipy which has python 3.6 support. I looked into the same and found v1.5.4 as the last version with support for python 3.6 support. You can download the whl for the same here.
Make sure you are downloading the file containing a file with cp36 in it, since those will be the files compatible with python 3.6

how do I install metapy for a specific version of python

I have Anaconda and Python 2.7 install on my PC. "metapy" is install and works just fine with Anaconda in eclipse. But when i try to run any .py file that contains "import metapy" from windows command line i get this error because i have python 2.7 in windows path:
ImportError: No module named metapy
I do not want to change or add Anaconda to windows path.
I tried to install metapy using pip install metay but i get this message
Requirement already satisfied: metapy in c:\anaconda3\lib\site-packages
Is there any way I can install metapy for the python 2.7?

How do you install PyDDE to Python 3.4 and not Python 2.4

I am currently trying to install the PyDDE package.
Going to the command line and running pip install PyDDE initially didn't work, so I downloaded the zip package from https://github.com/hensing/PyDDE
and then I navigated to the unzipped folder and used the python setup.py command as specified in the installation instruction.
This installed the PyDDE module in python 2.7, and typing import PyDDE yields the module in 2.7. However, it does not install in 3.4.
I found this similar problem on stackoverflow (
Python 3.4 and 2.7: Cannot install numpy package for python 3.4
Installing numpy for Python 2.7 while also having Python 3.4 installed?
which provided solutions like using sudo pip and going to the python 3.4 folder and using easy_install PyDDE
Since it is already installed for python 2.7 when I use:
easy_install PyDDE or
pip install PyDDE
it happily tells me that pydde 0.2.2 is already installed/the active version, however, loading up Python 3.4 and importing PyDDE still doesn't work.
I have also tried python34 install PyDDE but python34 isn't a recognised command.
Any help would be appreciated.
You need to use pip3:
pip3 install PyDDE
pip installs python2 packages and pip3 does your python3 packages.
You need python3 in your pythonpath go to:
My Computer/Properties/Advanced System Settings/Environment Variables
And add C:\Python34\;C:\Python34\Scripts\ to your pythonpath.
Then download get-pip.py and run python34 get-pip.py

Python 3.3 and Installing PyOpenSSL on a Mac

I have python 3.3 working and can run some basic code (like print("Hello World")). Next I need so get PyOpenSSL set up. I've downloaded and unzipped the pyOpenSSL-master.zip from their github site, but I have no idea what to do with it next.
I moved the unzipped directory into /libs, cd into /libs/pyopenssl-master and did python setup.py install --user. But that failed with
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
Other than the directory not existing, which I assume that the installer would create, the bigger problem is that it appears to be trying to write to the python 2.7 folder and I'm using 3.3.
If you can't tell, I'm pretty much out of my element. I've never installed a Python library before and I'm also not great with OSX installations. Can anyone help me get this set up? Thanks.
Here's how you can install pyOpenSSL on OS X (or just about any other platform):
Install pip
Install it using a package for your operating system. For example, if you use brew, brew install pip.
If there is no package for your operating system, download https://raw.github.com/pypa/pip/master/contrib/get-pip.py
Run it (probably as root, unfortunately): sudo python get-pip.py
Install virtualenv using pip - pip install --user virtualenv
Create a virtualenv to install pyOpenSSL into - virtualenv ~/Environments/pyOpenSSL-stuff
Activate the virtualenv - . ~/Environments/pyOpenSSL-stuff/bin/activate
Install pyOpenSSL with pip - pip install pyopenssl
At this point you have pyOpenSSL installed in a virtualenv. Any time you want to use pyOpenSSL you'll need to activate the virtualenv. I suggest that you actually create a virtualenv for each project of yours that you work on and install all of the necessary dependencies for each project into that project's virtualenv.
This does result in a lot of duplicate installations of packages. Unfortunately this seems to be the state of the art for Python package installation. Fortunately most Python packages are rather small.

Categories