ilukasschneider
ilukasschneider

Reputation: 75

Importing Modules with Hydrogen in Atom

I can run the code but trying to use the Hydrogen package in Atom I have problems importing some (not all) modules and I do not why. I do use Hydrogen with Python3.6 and i did install all needed modules with pip3.

ImportErrorTraceback (most recent call last) in () ----> 1 import sklearn

ImportError: No module named sklearn

Upvotes: 2

Views: 2176

Answers (1)

Rory L
Rory L

Reputation: 53

I think your problem is to do with where the kernel is starting. In the Hydrogen settings, look for the option 'Directory to start kernel in'. The default is to always start in the directory in which Hydrogen was first invoked. If you have installed modules in a different working directory, then they will not be found, unless you change this option to 'current directory of the file' (restart required)

You can check your sys.path to see where the kernel is looking for modules. If all else fails, you can manually move the installed packages to the 'site-packages' folder, whose location is revealed by sys.path.

I thought pip would put the packages in the right place by default, but maybe not - especially if you have virtual environments set up.

You can use the command pip show <package name> to get the path to which pip has installed the package in question.

Upvotes: 5

Related Questions