Espejito
Espejito

Reputation: 480

Module not found error: what is Jupyter core?

I think this code

jupyter nbconvert --to script weather_observations.ipynb

should convert a Jupyter script to a Python script, but I get this error

File "/Library/Frameworks/Python.framework/Versions/3.8/bin/jupyter", line 6, in <module>
    from jupyter_core.command import main
ModuleNotFoundError: No module named 'jupyter_core'
(base) Users-MacBook-Air-2:~ user$ python weather_observations.py
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'weather_observations.py': [Errno 2] No such file or directory

What is that Jupyter core?

Here is the where I got the ipynb

https://aaltoscicomp.github.io/python-for-scicomp/_downloads/4b858dab9366f77b3641c99adece5fd2/weather_observations.ipynb

Upvotes: 0

Views: 1391

Answers (1)

ahmad
ahmad

Reputation: 11

For the first error, you do not seem to have jupyter-core installed. But I also noticed you are on your base environment. I would suggest creating an environment, conda create --name <env_name> python=3.8 [change env_name] to a name of your choice. Then install the necessary packages using pip, pip install jupyter.

For the second error, you seem to not be in the directory where the file 'weather_observations.py' is. Navigate to that directory usin cd then try re-running.

Upvotes: 1

Related Questions