使用pip安装后无法运行ipython

时间:2015-10-06 16:21:07

标签: python pip ipython

尝试通过pip安装后运行ipython:

$ ipython
    -bash: ipython: command not found

我是否需要在路径中添加目录? python安装指南没有提到它:

http://ipython.org/install.html

似乎所有东西都按预期安装:

$ pip show ipython
---
Metadata-Version: 2.0
Name: ipython
Version: 4.0.0
Summary: IPython: Productive Interactive Computing
Home-page: http://ipython.org
Author: The IPython Development Team
Author-email: ipython-dev@scipy.org
License: BSD
Location: /Library/Python/2.7/site-packages
Requires: traitlets, pickleshare, simplegeneric, decorator, gnureadline, appnope, pexpect

我目前在Mac OS X 10.11上使用python版本2.7.10

修改

我已尝试卸载并重新安装,现在我收到此错误:

sudo -H pip install ipython
Collecting ipython
  Downloading ipython-4.0.0-py2-none-any.whl (730kB)
    100% |████████████████████████████████| 733kB 459kB/s 
Requirement already satisfied (use --upgrade to upgrade): traitlets in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): pickleshare in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): decorator in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): gnureadline in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): appnope in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): pexpect in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in /Library/Python/2.7/site-packages (from traitlets->ipython)
Requirement already satisfied (use --upgrade to upgrade): path.py in /Library/Python/2.7/site-packages (from pickleshare->ipython)
Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in /Library/Python/2.7/site-packages (from pexpect->ipython)
Installing collected packages: ipython
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 646, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 803, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 998, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 371, in move_wheel_files
    clobber(source, dest, False, fixer=fixer, filter=filter)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 310, in clobber
    ensure_dir(destdir)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/__init__.py", line 71, in ensure_dir
    os.makedirs(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/share'

我猜这个错误可能是第一次出现,因为它仍然认为它已经正确安装了!

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。卸载并重新安装ipython时,由于权限错误。您可以删除目录并通过" sudo pip install ipython"重新安装。 我不知道为什么,但它安装在&usr / local / bin'而不是' usr / bin'。我必须使用" sudo ipython"运行它。