-2

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)
FHTMitchell
  • 11,793
  • 2
  • 35
  • 47
code
  • 37
  • 6
  • 2
    it's already installed. Does `import xlrd` not work? – FHTMitchell Aug 21 '18 at 11:19
  • 1
    why don't you use virtualenv ? That will make your life much easier – Arghya Saha Aug 21 '18 at 11:25
  • can be possible easily if you are working in virtual environment, then you won't need to define python or pip version. – Upasana Mittal Aug 21 '18 at 11:26
  • its installed in anaconda installation. python 3.6 is a seperate directory as you can see above. and i want it to be available for all programs so virtualenv is not an option – code Aug 21 '18 at 11:35
  • It is not about directories but about interpreters. Just do `yourpython -m pip install xlrd` where `yourpython` is the python interpreter for which you want to install xlrd. – Stop harming Monica Aug 21 '18 at 11:48
  • done it already but it show it not not a recognized command – code Aug 21 '18 at 11:50
  • these commands are just samples. I've tried almost 20-25 commands with all the possible combination mentioned in both the links given above – code Aug 21 '18 at 11:59

3 Answers3

1

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.

georgexsh
  • 15,984
  • 2
  • 37
  • 62
0

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!

0

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

code
  • 37
  • 6