我无法在mac os中使用pip安装scikit-image

时间:2017-11-13 22:49:47

标签: python macos python-2.7 scikit-image

我想安装scikit-image来做项目。我用brew安装了python 2.7。我还专门为mac os安装了ignore-six库

      sudo pip install virtualenvwrapper --upgrade --ignore-installed six

然后我用pip安装它:

    pip install scikit-image

    sudo pip install scikit-image

它显示如下错误:

                  Installing collected packages: PyWavelets, scipy, scikit-image, singledispatch, certifi, backports-abc, tornado, nose
       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 342, in run
           prefix=options.prefix_path,
         File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
           **kwargs
         File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
           self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
         File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
           isolated=self.isolated,
         File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
           clobber(source, lib_dir, True)
         File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in clobber
           ensure_dir(destdir)
         File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
           os.makedirs(path)
         File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
           mkdir(name, mode)
       OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/PyWavelets-0.5.2.dist-info'

更新

我用virtualenv解决了这个问题。这是solution

在Mac上全局安装virtualenv:

 $ [sudo] pip install virtualenv
 Then use virtualenv command to create a new (a copy) of Python executable:

 $ cd your/prefred/folder
 $ virtualenv your_project
 Activate the virtualenv:

 $ source your_project/bin/activate
 Your virtualenv is created and activated (the prompt is changed to show the           
  activation). You can install anything in it:

 $ pip install -U scikit-image

0 个答案:

没有答案