在osx上卸载scipy时遇到问题 [英] Have trouble uninstall scipy on osx

查看:133
本文介绍了在osx上卸载scipy时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用2.7和3.4的多版本python时遇到了这个特定的麻烦. python2.7是由Apple本身安装的,而我自己安装了3.4,它的工作正常.
当我使用pip安装sklearn系列(scikit-learn numpy scipy)时,由于此pip已绑定到python3.4,因此python2.7无法使用它,而我的项目这次需要2.7.
我不会卸载3.4.

I've faced this specific trouble with multi-version python as 2.7 and 3.4. python2.7 was installed by apple itself and I installed 3.4 myself and it works just fine.
When i use pip to install sklearn series(scikit-learn numpy scipy), since this pip was bound to python3.4 so python2.7 couldnt use it, and my project needs 2.7 this time.
I'm not going to uninstall 3.4.

sh-3.2# python
Python 2.7.10 (default, Oct 23 2015, 18:05:06) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


这意味着我的默认python版本是2.7


this means my default version of python is 2.7

我的问题是我何时使用pip install&只需使用pip进行卸载,python3.4中的其他功能就可以正常工作.
要将numpy和scipy安装到python2.7,我下载了这些软件包并找到了setup.py,并使用sudo python setup.py install运行它们.

numpy看起来不错,但是scipy遇到了这样的麻烦

My Question is when i use pip install & uninstall just with pip, the extras in python3.4 works fine.
And to install numpy and scipy to python2.7 I download those package and find those setup.py and run them with sudo python setup.py install.

The numpy seems fine but the scipy have this trouble as

error: Command "/usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -arch x86_64 -fPIC -I/Library/Python/2.7/site-packages/numpy-1.12.0.dev0_d69c147-py2.7-macosx-10.11-intel.egg/numpy/core/include -c -c scipy/integrate/mach/d1mach.f -o build/temp.macosx-10.11-intel-2.7/scipy/integrate/mach/d1mach.o" failed with exit status 1

当我没有gfortran时,我在scipy下运行此"sudo python setup.py install"(当然我失败了,发现我需要一个).而在获取gfortran之后,我就被这个烦人的错误所困扰.

我的计划是先用pip卸载scipy,但我无法面对这个问题

I run this "sudo python setup.py install" under scipy when i didnt have gfortran(of course i failed and find out that i need one). And after get gfortran im stuck with this annoying error.

my plan is uninstall scipy with pip first but i cant as im facing this

$ pip2.7 uninstall scipy
DEPRECATION: Uninstalling a distutils installed project (scipy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling scipy-0.13.0b1:



/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy-0.13.0b1-py2.7.egg-info
Proceed (y/n)? y
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/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 336, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 742, 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 "/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: '/var/folders/8k/7_gm8zxx0zlg0nx4r5dg4rz00000gn/T/pip-hA6VUE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy-0.13.0b1-py2.7.egg-info'

我很沮丧,但仍在努力.寻求帮助.

我不是说英语的人.对不起我的英语不好.



更新:正好解决了这个问题,并已解决了其他所有问题,例如熊猫或sklearn

Im very frustrated but still working on it. and seeking for help.

Im not an english speaker.so sorry for my poor english.



UPDATE:just with this problem and ive fix all others like pandas or sklearn

sudo pip2.7 install numpy --upgrade
The directory '/Users/ink/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/ink/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting numpy
  Downloading numpy-1.11.0-cp27-cp27m-<br>macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.9MB)
    100% |████████████████████████████████| 3.9MB 275kB/s 
Installing collected packages: numpy
  Found existing installation: numpy 1.8.0rc1
    DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling numpy-1.8.0rc1:
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 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 736, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 742, 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 "/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-gJ8Ao6-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

推荐答案

有一个类似的问题,该问题通过重新安装python

Had a similar issue that was resolved by reinstalling python https://www.python.org/downloads/

这篇关于在osx上卸载scipy时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆