2013-08-16 2 views
2

Я установил научную среду python (numpy, scipy, matplotlib, pandas, ipython) некоторое время назад на OSX, используя пиво, и либо pip, либо easy_install (или 2 из них, я не запомнить). Теперь, если попытаться запустить IPython я получаю:ipython: команда не найдена на OSX

-> 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 

Я был удивлен, чтобы не видеть никакого каталога/бен.

Затем я попытался переустановить IPython

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

Это действительно сбивает с толку. Любая идея приветствуется.

+0

Вы уверены, что '' pip'', который вы называете, принадлежит Python Homebrew? Из вашего списка файлов кажется, что вы установили '' ipython'' в свою систему Python, поэтому он поместил исполняемый файл в ''/usr/local/share/python''. – fjarri

ответ

5

Создать .pydistutils.cfg в ваших $HOME следующего содержания

[global] 
verbose=1 

[install] 
install-scripts=$HOME/bin 

[easy_install] 
install-scripts=$HOME/bin 

Run

pip install -U --user --force ipython 

Посмотрите https://github.com/pypa/pip/issues/426

+3

ваше предложение приведет к 'error: невозможно объединить пользователя с префиксом, exec_prefix/home или install_ (plat) base'. Я смог исправить это, используя этот http://stackoverflow.com/questions/4495120/combine-user-with-prefix-error-with-setup-py-install. Теперь ipython работает нормально. –

0

обходной путь (по крайней мере, для IPython), чтобы добавить эти строки в ~/.pydistutils.cfg : [install] install-data=/usr/local install-scripts=/usr/local/bin

Смежные вопросы