首页 > 解决方案 > 无法在默认的 mac python 设置中更新 numpy

问题描述

我的设置:MacOS 10.12.3 默认 mac python 版本:2.7.10 默认 mac python numpy 版本:1.8

我想运行一个需要 numpy >1.9 的程序。我以为这很简单……但结果却很痛苦。我已经根据我发现的旧线程尝试过的事情......没有任何 成功:pip install numpy,,,。pip install --ignore-installed numpypip install numpy --upgradepip install --user -U numpy

我没有设法运行的是卸载默认的numpy,然后重新安装新的(使用pip uninstall numpy)。我得到了(即使使用 sudo):

Exception:   Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/uninstall.py", line
70, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 274, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 730, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 126, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 292, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 103, in copystat
os.chflags(dst, st.st_flags)   **OSError: [Errno 1] Operation not permitted:
'/tmp/pip-g1dBU9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'**

我确实设法获得了自制python3并让程序在终端中运行,但它的GUI版本是在另一个调用默认python2.7的程序(imageJ)中实现的,自然会失败。

有任何想法吗?

标签: pythonnumpypermissionspipimagej

解决方案


推荐阅读