简体   繁体   中英

Importing module in Jupyter Notebook

Resolved! Used thislink Thanks to all that helped!

Trying to import modules.

I installed anaconda3. I run jupyter through an executable jupyter-notebook.sh. As of now I don't use a venv.

I have tried all of the following methods, including reinstalling anaconda3 and python

  1. terminal --> pip install
  2. terminal --> pip3 install
  3. terminal --> export path to anaconda --> pip install
  4. terminal --> export path to anaconda --> pip3 install
  5. terminal --> export path to anaconda --> conda install
  6. In notebook --> !pip install

But all these methods don't work

Have spent tons of time searching through other stackoverflow tickets but to no avail. Would appreciate any help. Thank you.问题

Create a new conda virtual environment using the anaconda prompt.

conda create -n yourenvironmentname .

Activate this environment.

activate yourenvironmentname

Install the libraries you want and also do a conda install nb_conda .

Launch a notebook with jupyter notebook in your activate conda environment (ran from the conda prompt).

You can then create a new notebook and choose the newly created environment, you will then be able to import your modules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM