I am trying to install pandas using pip to run some pandas-based Python programs. I already installed pip. I tried googling and SO'ing but didn't find a solution to this error. Can somebody share your inputs on this?
C:\> pip install pandas
Error:
pip is not recognized as an internal or external command, operable program or batch file.
If you are a windows user:
make sure you added the script(dir) path to environment variables
C:\Python34\Scripts
for more how to set path vist
Please Ensure you are using a virtualEnv this is how :
virtualenv -p python3 envname
source env/bin/activate
pip install pandas
on windows you have to add scripts exe in the CLASSPATH in order to use pip command
C:\Python34\Scripts\pip3.exe
i suggest you to use MINGW he can gives you a better environment to work with python
Reply to abccd and Question to anyone:
The command: C:\Python34\Scripts>py -3 -m pip install pandas
executed just fine. Unfortunately, I can't import Pandas.
Directory path: C:\users\myname\downloads\miniconda3\lib\site-packages
My Question: How is it that Pandas' dependency packages(numpy, python-dateutil, pytz, six) also having the same above directory path are able to import just fine but Pandas does not?
import pandas
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
import pandas
ImportError: No module named 'pandas'
I finally got Pandas reinstalled and imported with the help of the following web pages: *http://pandas.pydata.org/pandas-docs/stable/pandas.pdf (Pages 403 and 404 of 2215 ... 2.2.2 Installing Pandas with Miniconda) *https://conda.io/docs/user-guide/install/download.html *https://conda.io/docs/user-guide/getting-started.html
After installing Miniconda, I created a new environment area to get Pandas reinstalled and imported. This new environment included the current Python version 3.6.3. I could not import Pandas using Python 3.4.4.
install pip, securely download get-pip.py
Then run the following:
python get-pip.py
On Windows, to get Pandas running,follow the step given in following link
https://github.com/svaksha/PyData-Workshop-Sprint/wiki/windows-install-pandas
In my opinion, the issue is because the environment variable is not set up to recognize pip as a valid command.
In general, the pip in Python is at this location:
C:\Users\user\AppData\Local\Programs\Python\Python36\Scripts > pip
So all we need to do is go to Computer Name> Right Click > Advanced System Settings > Select Env Variable then under system variables > reach to Path> Edit path and add the Path by separating this path by putting a semicolon after the last path already was in the Env Variable.
Now run Python shell, and this should work.
Assuming you are using Windows OS.
All you need to add the pip.exe
path to the Environment Variables (Path).
Generally, you can find it under ..Python\Scripts folder.
For me it is, C:\Program Files\Python36\Scripts\
pip install pandas make sure, this is 'pandas' not 'panda'
If you are not able to access pip, then got to C:\Python37\Scripts and run pip.exe install pandas.
Alternatively, you can add C:\Python37\Scripts in the env variables for windows machines. Hope this helps.
Source: Stackoverflow.com