LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't import Python package installed with pacman (https://www.linuxquestions.org/questions/linux-newbie-8/cant-import-python-package-installed-with-pacman-4175679075/)

ruy 07-20-2020 08:10 PM

Can't import Python package installed with pacman
 
Hello, I was reading and I decide install my python packages with pacman (I use 3 or 4 packages usually). But when I install it and try to use it with import, I have the issue:
ModuleNotFoundError: No module named pandas

The same error with numpy, matplotlib, statsmodels and beautifulsoup4 (these are the only packages I use).

I'm using spyder as editor (also installed with pacman).
I don't care the virtual environmet (I'm the only user of the PC) and don't create one. Only work with the scripts.

Thank you

Ruy

ondoho 07-21-2020 07:10 AM

Show us the code, and full error messages.

ruy 07-21-2020 03:46 PM

Hello ondoho, the full message is:

Traceback (most recent call last):
File "grafico.py", line 6, in <module>
import matplotlib.pytplot as plt
ModuleNotFoundError: No module named 'matplotlib.pytplot'


In this script I also load pandas and numpy.
In this case I'm using Vim and running the script in terminal, but the issue is the same with Spyder.

Thank you.

Ruy

ondoho 07-21-2020 04:51 PM

Look at a python program in your /usr/bin and see how it's done there.

ruy 07-21-2020 06:19 PM

Hello ondoho, thanks for your fast answer.
The only one difference in the python docs is that start the scrpit with the line:

#!/usr/bin/python3.8

Or some variation of this (/usr/bin/python2, .../env python, .../python).

Thank you.

Ruy


All times are GMT -5. The time now is 07:55 AM.