I'm using Anaconda on Windows x64. I'm trying to install some library using pip. However, the the command line isn't recognizing pip or any other scripts. The folder that they are all in is in both the user and system PATH variable. pip is there and works if I use the entire file path. Is there a way to fix this?
-
Does typing `python` do anything? – Peter Wood Mar 14 '15 at 23:53
-
1In the python command prompt no. In the anaconda command prompt, the output is "Python 3.4.1 |Anaconda 2.1.0 (64-bit)| (default, Sep 24 2014, 18:32:42) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information." – johnidel127 Mar 14 '15 at 23:55
-
What does typing `pip` in the anaconda command prompt do? – Peter Wood Mar 15 '15 at 00:01
-
Returns "'pip' is not recognized as an internal or external command, operable program or batch file." – johnidel127 Mar 15 '15 at 00:04
-
In the python command line prompt, type `import sys` then `sys.executable` – Peter Wood Mar 15 '15 at 00:04
-
Then check is `pip.exe` in the installation `Scripts` directory. – Peter Wood Mar 15 '15 at 00:05
-
pip.exe is in the Scripts directory. sys.executable returns "C:\\Anaconda3\\python.exe" – johnidel127 Mar 15 '15 at 00:08
-
Is the `Scripts` directory on your `PATH`? You can see your PATH by running `path` at the command prompt. – asmeurer Mar 16 '15 at 16:10
7 Answers
When creating your environment, you need to specify pip as a dependency:
conda create --name my-env pip
activate my-env
pip install ...
Installing a new environment with all default anaconda packages:
conda create --name my-env anaconda

- 4,039
- 2
- 29
- 38
-
Do you know how to install pip on Windows if one didn't specify pip as a dependency? – duhaime Aug 25 '21 at 17:14
-
See https://stackoverflow.com/questions/33680946/how-to-add-package-to-conda-environment-without-pip Note that its best not to gradually add packages to a conda environment though. Instead, add all dependencies to a conda environment and reinstall the environment from there. This helps to avoid package conflicts and ensures you have a shareable and reproducible environment. – DieterDP Aug 26 '21 at 10:17
Do this worked for me:
conda install pip
and try:
pip install package_name

- 36,322
- 27
- 84
- 93

- 141
- 1
- 4
Make sure you have the following dir added to PATH:
C:\Python27\Scripts

- 1,088
- 14
- 22
-
-
I'm not sure how Anaconda is setup but I assume that there's some similarity to Python regarding the Scripts directory @asmeurer – mmenschig Mar 16 '15 at 21:08
-
This works to a point, but fails I think because an environment isn't setup with the packages pip needs to connect to Pypa. Using the Anaconda prompt and running pip install seems to be the easiest way to install packages in anaconda. I'm just starting to learn how to use anaconda and about environments. – Gerald Leese Feb 24 '19 at 19:13
I worked for me if I start cmd and do cd C:\Users\ComputerName\Python27\Scripts Then I typed in 'pip install "library"' and it worked! If you don't know how to access cmd just press Win+R and type in cmd!
Hope it helped!

- 69
- 1
- 2
- 10
I had it myself because of my username which uses this character "ï" which causes an encoding problem in the PATH variable. Therefore, scripts cannot be found by anaconda. I had to install Anaconda For everyone and not just the current user to solve this problem.

- 661
- 5
- 22
Add script folder location to path, for individual user installation it will be "C:\Users\<user>\Anaconda3\Scripts"
and for everyone installation it can be found in Program Files "C:\Program Files\Anaconda3\Scripts
"

- 686
- 5
- 10