2017-12-05 7 views
0

私はAnacondaをインストールしました。私はconda環境とcondaコマンドを使ってソフトウェアをインストールします。Jupyterノートブックのバージョンを表示し、Jupyterノートブックでセルを実行するにはどうすればよいですか?私はエラーが発生します:悪い通訳

私が入力した場合: jupyter notebook --version

を私は次のエラーを取得する:

zsh: /Users/cr517/.local/bin/jupyter: bad interpreter: /Users/cr517/anaconda/envs/snakes/bin/python: no such file or directory 5.2.1

私は次のように入力してjupyterノートブックを開くことができます。jupyter notebook xyz.ipynbが、私は任意のセルを実行することはできません。私はそれを実行した後、セルは*とマークされています。

zsh: /Users/cr517/.local/bin/jupyter: bad interpreter: /Users/cr517/anaconda/envs/snakes/bin/python: no such file or directory 
[I 21:01:55.558 NotebookApp] JupyterLab alpha preview extension loaded from /Users/cr517/anaconda/lib/python3.6/site-packages/jupyterlab 
[I 21:01:55.558 NotebookApp] JupyterLab application directory is /Users/cr517/anaconda/share/jupyter/lab 
[I 21:01:55.564 NotebookApp] Serving notebooks from local directory: /Users/cr517/Documents/teach/demonstrations/python/python-functions-and-modules-master 
[I 21:01:55.564 NotebookApp] 0 active kernels 
[I 21:01:55.564 NotebookApp] The Jupyter Notebook is running at: 
[I 21:01:55.564 NotebookApp] http://localhost:8888/?token=0a0b3368be051aceea02ddfdb677ba5b48724f050e78fa59 
[I 21:01:55.564 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 
[C 21:01:55.584 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time, 
    to login with a token: 
     http://localhost:8888/?token=0a0b3368be051aceea02ddfdb677ba5b48724f050e78fa59 
[I 21:01:55.852 NotebookApp] Accepting one-time-token-authenticated connection from ::1 
[I 21:01:57.808 NotebookApp] Kernel started: 944ec290-db3a-4dc1-97fb-cf440cc384ce 
/Users/cr517/anaconda/bin/python: No module named ipykernel_launcher 
[I 21:02:00.804 NotebookApp] KernelRestarter: restarting kernel (1/5) 
/Users/cr517/anaconda/bin/python: No module named ipykernel_launcher 
[I 21:02:03.813 NotebookApp] KernelRestarter: restarting kernel (2/5) 
/Users/cr517/anaconda/bin/python: No module named ipykernel_launcher 
[I 21:02:06.824 NotebookApp] KernelRestarter: restarting kernel (3/5) 
/Users/cr517/anaconda/bin/python: No module named ipykernel_launcher 
[W 21:02:07.940 NotebookApp] Timeout waiting for kernel_info reply from 944ec290-db3a-4dc1-97fb-cf440cc384ce 
[I 21:02:09.833 NotebookApp] KernelRestarter: restarting kernel (4/5) 
kernel 944ec290-db3a-4dc1-97fb-cf440cc384ce restarted 
/Users/cr517/anaconda/bin/python: No module named ipykernel_launcher 
[W 21:02:12.841 NotebookApp] KernelRestarter: restart failed 
[W 21:02:12.842 NotebookApp] Kernel 944ec290-db3a-4dc1-97fb-cf440cc384ce died, removing from map. 
kernel 944ec290-db3a-4dc1-97fb-cf440cc384ce restarted failed! 
[W 21:02:12.873 NotebookApp] 410 DELETE /api/sessions/eaa457a0-7628-42c4-927f-1428b4ec3b68 (::1): Kernel deleted before session 
[W 21:02:12.873 NotebookApp] Kernel deleted before session 
[W 21:02:12.873 NotebookApp] 410 DELETE /api/sessions/eaa457a0-7628-42c4-927f-1428b4ec3b68 (::1) 2.10ms referer=http://localhost:8888/notebooks/python_fm_1.ipynb 

が実際に何/Users/cr517/anaconda/envs/snakes/bin/pythonありませんが、なぜJupyterノートブックです:私はjupyterのnotebokを開いた後、端末にこれを取得

The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened.

:すぐに、このメッセージがポップアップボックスに表示されますこれを使用しようとしていますか?私はうまく機能するPythonをここに持っています:

which python 
/Users/cr517/anaconda/bin/python 

which -a python 
/Users/cr517/anaconda/bin/python 
/usr/local/bin/python 
/usr/bin/python 

which -a jupyter 
/Users/cr517/.local/bin/jupyter 
/Users/cr517/.local/bin/jupyter 
/Users/cr517/.local/bin/jupyter 

echo $PATH 
/usr/local/opt/[email protected]/bin:/Users/cr517/Documents/phd/project/output/software/DEXTRACTOR:/Users/cr517/Documents/phd/project/output/software/DAZZ_DB:/Users/cr517/Documents/phd/project/output/software/DASCRUBBER:/Users/cr517/Documents/phd/project/output/software/subread-1.5.2-MaxOSX-x86_64/bin:/Users/cr517/Documents/phd/project/output/software/SHRiMP_2_2_2/utils:/Users/cr517/Documents/phd/project/output/software:/Users/cr517/Documents/phd/project/output/software/fastx/bin:/Users/cr517/.local/bin:/Users/cr517/Documents/phd/project/output/software/DAZZ_DB:/Users/cr517/Documents/phd/project/output/software/DASCRUBBER:/Users/cr517/Documents/phd/project/output/software/subread-1.5.2-MaxOSX-x86_64/bin:/Users/cr517/Documents/phd/project/output/software/SHRiMP_2_2_2/utils:/Users/cr517/Documents/phd/project/output/software:/Users/cr517/Documents/phd/project/output/software/fastx/bin:/Users/cr517/.local/bin:/Users/cr517/Documents/phd/project/output/software/DASCRUBBER:/Users/cr517/Documents/phd/project/output/software/subread-1.5.2-MaxOSX-x86_64/bin:/Users/cr517/Documents/phd/project/output/software/SHRiMP_2_2_2/utils:/Users/cr517/Documents/phd/project/output/software:/Users/cr517/Documents/phd/project/output/software/fastx/bin:/Users/cr517/.local/bin:/Users/cr517/Documents/phd/project/output/software/subread-1.5.2-MaxOSX-x86_64/bin:/Users/cr517/Documents/phd/project/output/software/SHRiMP_2_2_2/utils:/Users/cr517/Documents/phd/project/output/software:/Users/cr517/Documents/phd/project/output/software/fastx/bin:/Users/cr517/.local/bin:/Users/cr517/Documents/phd/project/output/software:/Users/cr517/Documents/phd/project/output/software/STAR:/Users/cr517/Documents/phd/project/output/software/fastx/bin:/Users/cr517/.local/bin:/Users/cr517/.local/bin:/Users/cr517/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/ncbi/blast/bin:/Library/TeX/texbin:/Users/cr517/Documents/phd/project/multibreak-sv/lib:/Users/cr517/Documents/phd/project/output/software/PBSuite_15.8.24/pbsuite:/Users/cr517/Documents/phd/project/output/software/PBSuite_15.8.24/bin/:/Users/cr517/Documents/phd/project/output/software/blobology 
    /Users/cr517/.local/bin/jupyter 
    /Users/cr517/.local/bin/jupyter 
    /Users/cr517/.local/bin/jupyter 
    /Users/cr517/anaconda/bin/jupyter 
    /usr/local/bin/jupyter 

jupyter kernelspec list 
zsh: /Users/cr517/.local/bin/jupyter: bad interpreter: /Users/cr517/anaconda/envs/snakes/bin/python: no such file or directory 
Available kernels: 
    python3 /Users/cr517/anaconda/lib/python3.6/site-packages/ipykernel/resources 
    ir   /Users/cr517/anaconda/share/jupyter/kernels/ir 
    python2 /usr/local/share/jupyter/kernels/python2 

jupyter notebook私のディレクトリはWebブラウザで開きますが、新しいノートブックは作成されません。

私はターミナルでpython --versionを入力して得た:

Python 3.6.3 :: Anaconda custom (x86_64) 
+0

を実行して再インストールしている場合は、あなたがアナコンダからもらった1の外部にある別のjupyterノートバージョンがありますか? – Usernamenotfound

+0

"python --version"と入力するとどうなりますか? – Usernamenotfound

答えて

1
  • これは間違いなく、パスの問題です:あなたは/Users/cr517/anaconda/bin/python
  • であなたのanaconddaのPythonインタプリタのパスを持っている。しかし、あなたのjupyterは/Users/cr517/.local/bin/jupyterを指しているが、それすべきである/Users/cr517/anaconda/bin/jupyter
  • 次のコマンドを実行します。gedit /Users/cr517/anaconda/bin/jupyter
  • チェックjupyterのハードコードされたパスを持っているし、パスがそれ/Users/cr517/anaconda/bin/jupyter
  • 作るよりも/Users/cr517/anaconda/bin/jupyterていない場合は、ファイル内のパスが正しいかどうか
  • である。しかし、問題がないかどうかチェックする開かれたファイルの最初の行あなたがそうするなら、他のjupyterファイルがあるのでここで解決してくださいls *jupyter*これらのファイルの多くは間違っているかもしれないハードコードされたパスを持っています。なぜなら彼はipynbを開くことはできますがセルを作成することはできません。
  • これはあまりにもdo ... ...すべてのファイルのパスを手動で変更するには
  • anacondaを再インストールするだけで問題は解決されます
  • このbash Anaconda....sh -b -p "Users/cr517/anaconda"
関連する問題