# New to jupyter notebook but not new to python (former Enthought fan)

**URL:** <https://discourse.jupyter.org/t/new-to-jupyter-notebook-but-not-new-to-python-former-enthought-fan/7363>\
**Category:** Notebook\
**Created:** [January 4, 2021, 2:30pm UTC](https://discourse.jupyter.org/t/new-to-jupyter-notebook-but-not-new-to-python-former-enthought-fan/7363 "2021-01-04T14:30:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kampmannpeine](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/kampmannpeine/32/3379_2.png) [@kampmannpeine](https://discourse.jupyter.org/u/kampmannpeine)\
**Post date:** [January 4, 2021, 2:30pm UTC](https://discourse.jupyter.org/t/new-to-jupyter-notebook-but-not-new-to-python-former-enthought-fan/7363/1 "2021-01-04T14:30:02Z")

</div>

I am rather new to jupyter notebook, although I worked quite a bit with the 32-bit version of Enthought on a Debian Linux 32-bit machine. Then I switched to a newer 64-bit machine with Debian 9 64-bit. And the canopy-version of Enthought did not work.

Because RTP recommended it: I went to anaconda … 😃

Now I am playing with the notebook issues and found some strange effects, part of them having been solved by this discourse platform like implementing the environment variable PYTHONPATH.

So much of my problems seem to stem from not understanding the pertaining documentation (I downloaded a ~100 page pdf-file) …

Now within the modules to be imported to notebook I had to install Nio and Ngl.

I did this:  
_**(base) joerg@primergy:~$ conda create --name pyn\_env --channel conda-forge pynio pyngl**_

and got the following results on a terminal-console:  
_ **lot of stuff which was ok anyway** _

next I did:

_(base) joerg@primergy:~ conda activate pyn\_env\* \*(pyn\_env) joerg@primergy:~ **python** _  
\*Python 3.8.6 | packaged by conda-forge | (default, Dec 26 2020, 05:05:16) \*  
_[GCC 9.3.0] on linux_  
_Type “help”, “copyright”, “credits” or “license” for more information._  
_\>\>\> **import Nio** _  
_\>\>\> **import Ngl** _

print(Nio. **version** )?\*  
_\>\>\> **print ( Nio.version)**_  
_1.5.5_  
_\>\>\> **print ( Ngl.version)**_  
_1.6.1_  
_\>\>\>_

so far so good,

Next step was to use **Nio** and **Ngl** within jupyter.  
I started a jupyter machine - but it did **not** find the newly installed modules.

 ![grafik](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/b/b71bfbfe2ab5343d81558cb8952305b7a75130b9.png)

What did i **forget** to do within jupyter?

I forgot - after calling the conda command (above) I at the start of this command’s output I got the following:

_Collecting package metadata (current\_repodata.json): done_  
_Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source._  
_Collecting package metadata (repodata.json): done_  
_Solving environment: done_

_## Package Plan ##_

- environment location: /home/joerg/anaconda3/envs/pyn\_env\*
- added / updated specs:\*
- 
  - pyngl\*

- 
  - pynio\*  
_The following packages will be downloaded:_

_[…]_

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [January 4, 2021, 5:02pm UTC](https://discourse.jupyter.org/t/new-to-jupyter-notebook-but-not-new-to-python-former-enthought-fan/7363/2 "2021-01-04T17:02:26Z")

</div>

Within a cell in your Jupyter session, run the following:

```python
%conda install -c conda-forge pynio
%conda install -c conda-forge pyngl

```

This will insure the environment the your Jupyter session is being served from installs the packages in the right location. It is now the preferred way to using conda and pip if you are working in notebooks. The syntax for pip is `%pip install <package_name>`. The simplified version for conda, if you aren’t looking to specify the channel, is `%conda install <package_name>`. See [here](https://hub.packtpub.com/ipython-7-3-releases-with-conda-and-pip-magics-and-python-3-8-compatibility/) and [here](https://twitter.com/jakevdp/status/1139213090745020416).  
You should see `Note: you may need to restart the kernel to use updated packages` at the bottom when it is done. After installation, restart the kernel before trying the `import` statements. I found that `import Nio` definitely **required a restart**.

As a former Canopy user myself, I can somewhat understand your pain. However, after learning a few of the more general and open practices, you should find this all makes your efforts vastly more portable, shareable, and reproducible.

---

<div class="post-metadata">

**Author:** ![kampmannpeine](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/kampmannpeine/32/3379_2.png) [@kampmannpeine](https://discourse.jupyter.org/u/kampmannpeine)\
**Post date:** [January 8, 2021, 11:11pm UTC](https://discourse.jupyter.org/t/new-to-jupyter-notebook-but-not-new-to-python-former-enthought-fan/7363/3 "2021-01-08T23:11:13Z")

</div>

Trying to get all the python 2.7 modules run under Python3 is not easy, so I installed python 2,7 with anaconda. However the issue of PYTHONPATH is not yet solved. Can you advice me how to do?

I did when installing P2.7:  
after installing -\>  
create an …(envs/py2 and …/envs/py3  
still have an …/envs/pyn\_new with a modified Jason-file for the kernel.

Where do I create the json-file for Python2?

---

<div class="post-metadata">

**Author:** ![agoose77](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/agoose77/32/3455_2.png) [@agoose77](https://discourse.jupyter.org/u/agoose77)\
**Post date:** [September 20, 2021, 11:23am UTC](https://discourse.jupyter.org/t/new-to-jupyter-notebook-but-not-new-to-python-former-enthought-fan/7363/4 "2021-09-20T11:23:58Z")

</div>

Why do you need to set `PYTHONPATH`?

EDIT: Didn’t see that this was an 8-mo old issue.
