crystal
crystal

Reputation: 101

ModuleNotFoundError while package already installed

My distribution is WinPython and I use Spyder as an IDLE, my python version is 3.6.5.

Although I have so many modules (from the WinPython download) like pip, pandas, and numpy that work perfectly, I want now to download another package called Swampy.

So, I wrote to my IPython console: !pip install Swampy and it worked perfectly but when I wrote import Swampy the result was a ModuleNotFoundError!

Lastly, I have to mention that all the packages seem to be here C:\Users\MY_USERNAME\Downloads\WinPython\python-3.6.5.amd64\Lib\site-packages

Upvotes: 1

Views: 261

Answers (3)

crystal
crystal

Reputation: 101

I realized that all this time I was writing the name of the package wrong! Although I installed it as Swampy it only works if you write import swampy.

Oh god! I suck...

Anyway, thank you all for your valuable time!

Upvotes: 1

Vicrobot
Vicrobot

Reputation: 3988

Move that package to the dist-packages directory which is near to site-packages dir. This will surely solve the problem.

As your mentioned path:- C:\Users\MY_USERNAME\Downloads\WinPython\python-3.6.5.amd64\Lib\site-packages

to

C:\Users\MY_USERNAME\Downloads\WinPython\python-3.6.5.amd64\Lib\dist-packages

Upvotes: 0

Andrew Morozko
Andrew Morozko

Reputation: 2816

You should installing package via this syntax <your python interpreter> -m pip install ...

The thing is, pip in your system can be tied to another python interpreter, not the one you're using. You say that your python version is 3.6.1, but packages are installed in python-3.6.5 directory, makes it likely to be a mismatch.

Upvotes: 0

Related Questions