Skip to content
Advertisement

I installed package, but python said No moudel any packages I try to install it

I try using pip and pip3 and python -m pip and all ways to install. The terminal says the packages already installed after the first try to install, but when I try to import the package I had error no moudel name.

enter image description here

enter image description here

enter image description here

I feel the peoblem coming form here enter image description here

But I am not sure

And when I go to packages in pycharm I saw the packages not installed

enter image description here

I appreciate your help

Advertisement

Answer

I’m assuming you’re using windows.

It looks like you install the package directly in your system and PyCharm are using a virtual environment to run your code.

Try to activate this virtual environment before run your code:

source venvScriptsactivate

If you see “(venv)” at the begging of your terminal prompt the virtual environment are activated.

Run pip list to check what packages are installed in there and probably you have to install your package another time, this time in your activated virtual environment. The official documentation will help to understand how and why use virtual environments.

After that you can try to run your code directly from the terminal:

python your_file.py
Advertisement