jupyter notebookをインストールしたのですが、下記のようなエラーが出て起動できません。
環境は Mac OS 10.3.6
pythonのバージョンは 3.6.5 です。
terminal
1$ jupyter notebook 2Traceback (most recent call last): 3 File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 10, in <module> 4 import sqlite3 5 File "/Library/Frameworks/SQLite3.framework/Versions/E/Python/3.6/sqlite3/__init__.py", line 23, in <module> 6 from sqlite3.dbapi2 import * 7 File "/Library/Frameworks/SQLite3.framework/Versions/E/Python/3.6/sqlite3/dbapi2.py", line 27, in <module> 8 from sqlite3._sqlite3 import * 9ImportError: dlopen(/Library/Frameworks/SQLite3.framework/Versions/E/Python/3.6/sqlite3/_sqlite3.cpython-36m-darwin.so, 2): Library not loaded: /Library/Frameworks/SQLite3.framework/Versions/D/SQLite3 10 Referenced from: /Library/Frameworks/SQLite3.framework/Versions/E/Python/3.6/sqlite3/_sqlite3.cpython-36m-darwin.so 11 Reason: image not found 12 13During handling of the above exception, another exception occurred: 14 15Traceback (most recent call last): 16 File "/Library/Frameworks/Python.framework/Versions/3.6/bin/jupyter-notebook", line 6, in <module> 17 from notebook.notebookapp import main 18 File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 86, in <module> 19 from .services.sessions.sessionmanager import SessionManager 20 File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 13, in <module> 21 from pysqlite2 import dbapi2 as sqlite3 22ModuleNotFoundError: No module named 'pysqlite2'
SQlite3の場所、バージョンを調べたところ下記のような結果
terminal
1$ which sqlite3 2/usr/bin/sqlite3 3 4$ sqlite3 --version 53.19.3 2017-06-27 16:48:08 2b0954060fe10d6de6d479287dd88890f1bef6cc1beca11bc6cdb79f72e2377b
jupyter notebookを入れる前に、QGis3.6をインストールするために、GDALなども入れていたためか、下記のような
エラーが出たので、強制的に
brew uninstall --ignore-dependencies python sqlite
を実行しました。
また、QGis3.6をインストールするときに、パスの設定なども触りました。
terminal
1$ brew rm python sqlite 2Error: Refusing to uninstall /usr/local/Cellar/sqlite/3.27.2 and /usr/local/Cellar/python/3.7.3 3because they are required by gdal, geos, glib, libdap, libspatialite, libxml2, numpy, osgeo-gdal and python@2, which are currently installed. 4You can override this and force removal with: 5 brew uninstall --ignore-dependencies python sqlite
パスの設定は下記のようになっています。
(拙い知識で設定しています)。
vi
1$ vi ~/.bash_profile 2if [ -f ~/.bashrc ]; then 3 . ~/.bashrc 4fi 5export PYENV_ROOT=${HOME}/.pyenv 6if [ -d "${PYENV_ROOT}" ]; then 7 export PATH=${PYENV_ROOT}/bin:$PATH 8 eval "$(pyenv init -)" 9fi 10export PATH=$HOME/.nodebrew/current/bin:$PATH 11alias python=python3
terminal
1 2$ echo $PATH 3/Library/Frameworks/Python.framework/Versions/3.6/bin: 4/Users/thgpf_mbp/.nodebrew/current/bin:/usr/local/bin: 5/usr/bin: 6/bin: 7/usr/sbin: 8/sbin: 9/Users/no136/.nodebrew/current/bin: 10/usr/bin/ 11
その後、
SQliteやpython、notebookも何度か再インストールしたり、ネットでの解決法など試みましたが、同じ結果になります。
アドバイスを頂けたら助かります。
追記:
参考にしたサイト
https://kjirou.github.io/old-sorenari-blog/articles/2659.html
https://github.com/Homebrew/legacy-homebrew/issues/17312
あなたの回答
tips
プレビュー