gpt4 book ai didi

macos - ipython:在 OSX 上找不到命令

转载 作者:行者123 更新时间:2023-12-01 23:55:15 27 4
gpt4 key购买 nike

我不久前在 OSX 上使用 brew 和 pip 或 easy_install(或其中的 2 个,我不记得了)安装了 python 科学环境(numpy、scipy、matplotlib、pandas、ipython)。现在,如果尝试运行 ipython,我会得到:

-> ipython
-bash: ipython: command not found

然后我做了:

-> sudo find . -iname "*ipython*"
Password:
find: ./dev/fd/3: Not a directory
find: ./dev/fd/4: Not a directory
./Users/jfk/.ipython
./usr/local/Cellar/matplotlib/1.2.0/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_console_highlighting.py
./usr/local/Cellar/matplotlib/1.2.0/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_console_highlighting.pyc
./usr/local/Cellar/matplotlib/1.2.0/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_directive.py
./usr/local/Cellar/matplotlib/1.2.0/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_directive.pyc
./usr/local/Cellar/matplotlib/1.2.1/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_console_highlighting.py
./usr/local/Cellar/matplotlib/1.2.1/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_console_highlighting.pyc
./usr/local/Cellar/matplotlib/1.2.1/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_directive.py
./usr/local/Cellar/matplotlib/1.2.1/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_directive.pyc
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/doc/ipython
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/doc/ipython/examples/core/ipython-get-history.py
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/doc/ipython/examples/core/ipython-qtconsole.desktop
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/doc/ipython/examples/core/ipython-sh.desktop
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/doc/ipython/examples/core/ipython.desktop
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/doc/ipython/examples/core/ipython_here_shell_extension.reg
./usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/share/man/man1/ipython.1
./usr/local/lib/python2.7/site-packages/IPython
./usr/local/lib/python2.7/site-packages/IPython/config/profile/cluster/ipython_config.py
./usr/local/lib/python2.7/site-packages/IPython/config/profile/cluster/ipython_config.pyc
./usr/local/lib/python2.7/site-packages/IPython/config/profile/math/ipython_config.py
./usr/local/lib/python2.7/site-packages/IPython/config/profile/math/ipython_config.pyc
./usr/local/lib/python2.7/site-packages/IPython/config/profile/pysh/ipython_config.py
./usr/local/lib/python2.7/site-packages/IPython/config/profile/pysh/ipython_config.pyc
./usr/local/lib/python2.7/site-packages/IPython/config/profile/sympy/ipython_config.py
./usr/local/lib/python2.7/site-packages/IPython/config/profile/sympy/ipython_config.pyc
./usr/local/lib/python2.7/site-packages/IPython/frontend/html/notebook/static/codemirror/README-IPython.rst
./usr/local/lib/python2.7/site-packages/IPython/frontend/html/notebook/static/codemirror/theme/ipython.css
./usr/local/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py
./usr/local/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.pyc
./usr/local/lib/python2.7/site-packages/IPython/frontend/qt/console/resources/icon/IPythonConsole.svg
./usr/local/lib/python2.7/site-packages/IPython/frontend/qt/console/rich_ipython_widget.py
./usr/local/lib/python2.7/site-packages/IPython/frontend/qt/console/rich_ipython_widget.pyc
./usr/local/lib/python2.7/site-packages/ipython-0.13.2-py2.7.egg-info
./usr/local/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_console_highlighting.py
./usr/local/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_console_highlighting.pyc
./usr/local/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_directive.py
./usr/local/lib/python2.7/site-packages/matplotlib/sphinxext/ipython_directive.pyc
./usr/local/share/python/ipython

我很惊讶没有看到任何/bin 目录。

然后我尝试重新安装ipython

-> pip install ipython
Requirement already satisfied (use --upgrade to upgrade): ipython in /usr/local/lib/python2.7/site-packages
Cleaning up...

这真是令人费解。欢迎任何想法。

最佳答案

在你的$HOME下面的内容中创建.pydistutils.cfg

[global]
verbose=1

[install]
install-scripts=$HOME/bin

[easy_install]
install-scripts=$HOME/bin

运行

pip install -U --user --force ipython  

看看https://github.com/pypa/pip/issues/426

关于macos - ipython:在 OSX 上找不到命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18264908/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com