Sur Linux, je gère Python via anaconda
. Cependant, comme il n'y avait pas de bon support pour amplpy
, j'ai installé cela via pip
.ipython reconnaît le module python, mais le portable jupyter ne fonctionne pas
Maintenant, quand je suis ipython, je peux faire
In [1]: import amplpy
In [3]: amplpy
Out[3]: <module 'amplpy' from '/home/x/anaconda3/envs/myenv3/lib/python3.6/site-packages/amplpy/__init__.py'>
et même, si je lance de nu python
. Cependant, quand je commence jupyter notebook
(myenv3) x:yy$ jupyter notebook
et ouvrir une nouvelle feuille python 3
, je reçois
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-93ba964328c9> in <module>()
----> 1 import amplpy
ModuleNotFoundError: No module named 'amplpy'
sys.path
me donne
['',
'/home/x/anaconda3/lib/python36.zip',
'/home/x/anaconda3/lib/python3.6',
'/home/x/anaconda3/lib/python3.6/lib-dynload',
'/home/x/anaconda3/lib/python3.6/site-packages',
'/home/x/anaconda3/lib/python3.6/site-packages/Sphinx-1.5.6-py3.6.egg',
'/home/x/anaconda3/lib/python3.6/site-packages/setuptools-27.2.0-py3.6.egg',
'/home/x/anaconda3/lib/python3.6/site-packages/IPython/extensions',
'/home/x/.ipython']
Quel est le mauvais dossier! ipython
a /home/x/anaconda3/envs/myenv3/lib/...
comme chemin!
Qu'est-ce qui peut provoquer une telle incohérence et comment le résoudre?
Oui, j'en suis certain – FooBar
Si vous utilisez 'conda install jupyter' pour installer jupyter, vous pouvez choisir quel noyau utiliser. Cochez le menu 'Kernel-> Changez le noyau'. Y a-t-il une autre option? – Sraw
@Sraw Devrait-il y avoir un menu "Kernel" dans le bloc-notes de Jupyter? Je n'en ai pas. Mais quand je crée un nouveau cahier, je peux choisir entre 'python3' et' julia', et je choisis le premier. – FooBar