Failed to import module named pandas

I have python 2.7 installed and python 3 installed.

I also have pip2.7 and pip3 installed.

I am using IPython Notebook in Jupyter console. Using the console, I can use every module I want, but I'm trying to use a terminal:

python script.py arg1 arg2 

I installed pandas 0.17.1 in both versions of python.

Then I run my script in the terminal and I get the following error:

 Traceback (most recent call last): File "script.py", line 21, in <module> import pandas as pd ImportError: No module named pandas 

but at startup

 pip install pandas pip2.7 install pandas 

He says:

  requirement already satisfied 

How to enable pandas for import in my script running in Terminal? Any ideas?

Thanks.

+5
source share
3 answers

try removing pandas first

 pip uninstall pandas pip2.7 uninstall pandas 

and then try reinstalling it.

0
source
  pip install numpy pip install pandas 

pip install django- pandas

django- pandas supports Django (> = 1.4.5)

In some cases, you need to install numpy in a virtual

0
source

try the following command (this is for ubuntu 16.04)

 sudo apt-get install python-pandas 
0
source

Source: https://habr.com/ru/post/1240845/


All Articles