- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still facing this issue even following the commands below:
!pip install pandas --user
import sys
sys.executable
!which python
/opt/intel/inteloneapi/intelpython/latest/bin/python
It happens in all environments (Python 3.7 oneAPI, Pytorch 1.4 AI Kit, etc.)
- Tags:
- pandas not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
Thanks for reaching out to us.
We will be very happy to help you with your issue. As going through the details you shared, the issue seems to be you are not installing pandas to the correct environment. This might be due to when we use ! in front of a Linux command, it will start a new terminal each time, so in this terminal your environment is not activated.
Also, the sys.executable commands takes the python path to be executed from kernel.json, in your case it's pytorch path. But, which python commands returns intelpython path for your case. It's because of this ! symbol.
To avoid this conflicts, you can follow any of the below workarounds provided.
Method 1: Start a Jupyter cell by using bash magic(%%bash). Now, export the correct python path and install the package.
Commands to be executed in the cell:-
%%bash
which python
export PATH=/opt/intel/inteloneapi/pytorch/latest/bin/:$PATH
which python
pip install pandas --user
Method 2: Install the package from terminal
Step 1: Initialize the oneAPI environment
source /opt/intel/inteloneapi/setvars.sh
Step 2 : Activate the pytorch environment
conda activate pytorch
Step 3: Install pandas in the environment
pip install pandas --user
Now, open the Jupyterlab on your browser and start the pytorch kernel.
Hopes this will resolve your issue. Please feel free to reach out to us in case of any queries.
Regards,
Chithra
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
Thanks for reaching out to us.
We will be very happy to help you with your issue. As going through the details you shared, the issue seems to be you are not installing pandas to the correct environment. This might be due to when we use ! in front of a Linux command, it will start a new terminal each time, so in this terminal your environment is not activated.
Also, the sys.executable commands takes the python path to be executed from kernel.json, in your case it's pytorch path. But, which python commands returns intelpython path for your case. It's because of this ! symbol.
To avoid this conflicts, you can follow any of the below workarounds provided.
Method 1: Start a Jupyter cell by using bash magic(%%bash). Now, export the correct python path and install the package.
Commands to be executed in the cell:-
%%bash
which python
export PATH=/opt/intel/inteloneapi/pytorch/latest/bin/:$PATH
which python
pip install pandas --user
Method 2: Install the package from terminal
Step 1: Initialize the oneAPI environment
source /opt/intel/inteloneapi/setvars.sh
Step 2 : Activate the pytorch environment
conda activate pytorch
Step 3: Install pandas in the environment
pip install pandas --user
Now, open the Jupyterlab on your browser and start the pytorch kernel.
Hopes this will resolve your issue. Please feel free to reach out to us in case of any queries.
Regards,
Chithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
Has the solution provided helped for you? Please let us know if the issue still persists.
Regards,
Chithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
Thanks for accepting the solution. We would discontinue monitoring this thread. Please feel free to raise a new thread if you have any further queries/issues.
Regards,
Chithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In most cases this error in Python generally raised:
You haven't installed Pandas explicitly with pip install pandas.
You may have different Python versions on your computer and Pandas is not installed for the particular version you're using.
You can run the following command in your Linux/MacOS/Windows terminal.
pip install pandas
To be sure you are not having multiple Python versions that are confusing, you should run following commands:
python3 -m pip install pandas
python3 -c 'import pandas'

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page