$ pip3 install pandas
Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/local/lib/python3.4/dist-packages
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2 in /usr/local/lib/python3.4/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/local/lib/python3.4/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /usr/local/lib/python3.4/dist-packages (from pandas)
I am getting Import error while my system has already satisfied all requirements.
The error “No module named pandas ” will occur when there is no pandas library in your environment IE the pandas module is either not installed or there is an issue while downloading the module right. Let’s see the error by creating an pandas dataframe. We will discuss how to overcome this error.
Pandas are distributed through pip as a wheel, which means you need to install wheel first and then pandas: The recommended way to install the pandas module is using pip or pip3 for Python3 if you have installed pip already. Alternatively, if you have easy_install in your system, you can install pandas using the below command.
Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (1.1.5) To get the pandas description in our environment we can use the show command. This can help keep track of the module and its installation. Summary: Powerful data structures for data analysis, time series, and statistics
You can update to the latest version of pandas (along with other modules) using conda: You can also create virtual environments and other useful things... The problem this solves, over pip, is that there are issues in software dependencies of some modules (scipy especially is tricky) or versions compiled against an incorrect version of numpy.
To be sure you are not having multiple Python versions that are confusing, you should run these commands
python -m pip install pandas
python -c 'import pandas'
It installs pandas
and imports it with the same python version.
Of course, you have to update the python
program in the above commands, in case it is not directly python
.
If you have a python3
executable, you can try
python3 -m pip install pandas
python3 -c 'import pandas'
You can even use absolute path, that would be returned by which python
, which python2
or which python3
, ...
I believe you have multiple python3's. If everything else suggested doesn't work for you, a easy/hacky way is to do this before you import pandas, it will guarantee the usage of the correct interpreter. Do this just once, after its successfully installed, you no longer need to do that:
import pip
pip.main(['install','pandas'])
import pandas
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With