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

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 … :smiley:

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.

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:

[…]

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

%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 and here.
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.

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?

Why do you need to set PYTHONPATH?

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