Hydrogen: Hydrogen is not able to locate python3 modules

Created on 30 Oct 2017  路  8Comments  路  Source: nteract/hydrogen

Description:
Hydrogen does not seem to find the modules installed in python3. I have both python 2.7 (/usr/bin/python) and python 3.6 (/usr/bin/python3) installed in Ubuntu 17.10.
If I enter python3 from Ubuntu Terminal, I have access to all packages that I installed with pip3. If I open jupyter and select python3, I have no problems.
screenshot from 2017-10-30 00-35-00

However, from inside Atom, whenever I attempt to import a module like pandas I receive an error:

**ImportErrorTraceback (most recent call last)
<ipython-input-6-af55e7023913> in <module>()
----> 1 import pandas as pd

ImportError: No module named pandas**

No such problems importing a standard module. It seems that hydrogen is not able to locate python3 packages that were additionally installed.

Steps to Reproduce:

  1. Open a python script in atom
  2. Try to execute (Ctrl+Enter) import pandas
    screenshot from 2017-10-30 00-30-10

Versions:

Which OS and which version of Hydrogen and Atom are you running?

Atom : 1.21.1
OS: Ubuntu 17.10

Logs:

Please post any error logs and the output of the developer tools as described in our Debugging Guide.

kernels

Most helpful comment

Sorry for the truble.

Have you also run the same command for Python 3?

pip3 install ipykernel --upgrade
python3 -m ipykernel install --user

All 8 comments

Have you installed the Python kernels for both versions according to https://nteract.io/kernels/python?

I went to nteract and ran python -m pip install ipykernel. No difference in the results.
screenshot from 2017-11-05 10-11-27

It seems the python 2 is getting selected no matter what. In the beginning, when I attempt a Ctrl+Enter on the first import line, I get to choose the kernel in the following screen:
screenshot from 2017-11-05 09-54-15
The text in the lower left corner of the screen shows that Python 3 has been selected
screenshot from 2017-11-05 10-06-28
However, if I import platform and print platform.python_version() I still see Python 2.7.14 being used.
screenshot from 2017-11-05 10-08-22
No wonder it can not find the modules installed with python 3.
screenshot from 2017-11-05 10-09-28
No such problems with Jupyter notebooks using python 3:
screenshot from 2017-11-05 10-23-39

I got mine to work by using the conda install instead of python

Sorry for the truble.

Have you also run the same command for Python 3?

pip3 install ipykernel --upgrade
python3 -m ipykernel install --user

@lgeiger That solved the problem. Thanks a lot.

@lgeiger Worked for me also. THANKS!

Thanks a lot. I have been the whole day with this thing. Finally worked out 馃サ

Thanks also this worked for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mike-MU10 picture Mike-MU10  路  4Comments

xmen1412 picture xmen1412  路  3Comments

tobiasbj picture tobiasbj  路  4Comments

neurotronix picture neurotronix  路  4Comments

HaoranXue picture HaoranXue  路  4Comments