Ich habe Jupyter mit Pip auf meinem Macbook Air installiert. Beim Versuch, den Befehl jupyter notebook
auszuführen, erhalte ich eine Fehlermeldung
jupyter: 'notebook' is not a Jupyter command
Ich habe die Option --h verwendet, um eine Auflistung aller Jupyter-Befehle zu erhalten, und in der Tat ist 'notebook' nicht einer der Befehle. Ich verwende Python 2.7 und es wurde bereits vor der Installation von Jupyter installiert.
Ich habe bei Google gesucht und sehe ein ähnliches Problem, mit dem einige Leute mit der neuesten Version von Jupyter konfrontiert waren, aber ich sehe keine Lösungen. Kann mich jemand in die richtige Richtung weisen?
which -a pip
:/usr/local/bin/pip
which -a jupyter
:/usr/local/bin/jupyter
Ich hatte das gleiche Problem. Nachdem ich bis zu einer Unmenge von Seiten online gesucht und möglichst viele Lösungen ausprobiert hatte, war dies das einzige, was für mich funktionierte:
pip uninstall notebook
pip install --upgrade notebook
Ich bin nicht sicher, dass das "Upgrade" notwendig ist, aber danach hatte ich es getan
jupyter-notebook
und
jupyter notebook
als Befehle.
Ich habe die gleiche Fehlermeldung wie Sie erhalten, wenn which jupyter
/usr/local/bin/jupyter
. Ich konnte den Fall durch Aktualisieren/Aktualisieren aller meiner ipython-Pakete lösen
Sudo -H pip install --upgrade "ipython[all]"
Ich habe es geschafft, den Fall in OS X El-Capitan 10.11.5 und Ubuntu Linux 16.04 zu lösen. Meine Jupyter-Version nach dem Upgrade ist 4.1.0. Mein Python ist 2.7.11 und höher. Meine Pip-Version ist 8.1.2.
Versuchen Sie, den Ordner, in den die Binärdateien installiert wurden, mithilfe des Befehls aus dem Basisordner herauszufinden:
find . -name "jupyter"
Wenn Sie eine Binärdatei finden, führen Sie sie direkt von diesem Pfad aus aus oder setzen Sie diesen Pfad auf $PATH
.
Anscheinend will Apple so viel wie möglich aus dem "Systems" -Ordner herausholen. Auf diese Weise können Sie Viren lokal für Ihren "Benutzer" und nicht für Ihren gesamten Computer aufbewahren.
Wenn Sie also Python und Jupyter mit einem "Benutzer" installiert haben, müssen Sie nur sicherstellen, dass sie gefunden werden, bevor Sie sie ausführen.
Wenn Sie dieses Problem haben und dieser Ordner ~/Library/Python/2.7/bin
vorhanden ist, gehen Sie wie folgt vor:
Fügen Sie Ihren Benutzer zu Ihrem Pfad hinzu $ echo 'export PATH="$HOME/Library/Python/2.7/bin:${PATH}"' >> ~/.bash_profile
Laden Sie Ihr Bash-Profil $ . ~/.bash_profile
erneut.
Jupiter mit Benutzerberechtigungen installieren $ python -m pip install jupyter --user
Beim Installieren von Jupyter unter MacOS Sierra wurde eine Fehlermeldung angezeigt. Ich hatte Schwierigkeiten, Jupyter zu installieren, und fand später heraus, dass die Ursache hier geteilt wurde.
Die Ausnahmen waren wie folgt -
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
copytree(src, real_dst, symlinks=True)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil', '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil', "[Errno 1] Operation not permitted: '/tmp/pip-tchevt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil'")]
Ich habe dieses Problem in MacOS Sierra und El-Capitan gefunden und dieses Problem behoben, indem ich sechs ignorierte.
pip install --upgrade notebook --ignore-installed six
verwenden Sie: Sudo pip install notebook
im Terminal.
Ich finde eine Lösung, die dieses Problem auf meinem Mac gelöst hat
Sudo rm -rf /Library/Frameworks/Python.framework
rm /usr/local/bin/python3*
brew uninstall python3
brew install python3
which python3
Sudo python3 -m pip install --upgrade pip
Sudo python3 -m pip install jupyter
which jupyter
jupyter notebook