【问题标题】:brew or pip - install credstash - errors - No named formulae found in taps / OSErr six-1.4.1-py2.7.egg-info operation not permittedbrew 或 pip - 安装 credstash - 错误 - 在水龙头中找不到命名公式/OSErr 6-1.4.1-py2.7.egg-info 操作不允许
【发布时间】:2017-05-02 17:29:43
【问题描述】:

在我的 Mac 终端窗口中出现以下错误。

$ pip --version
pip 6.1.1 from /Library/Python/2.7/site-packages (python 2.7)

Python 版本是 2.7.10

尝试使用 brew 安装 credstash 时,出现以下错误。

$ `which python` --version && brew update && brew install credstash
Python 2.7.10
Already up-to-date.
Error: No available formula with the name "credstash" 
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.

当我尝试使用 brew 安装 pip3 时遇到了类似的错误。

尝试从 pip 安装 credstash,但也出错了。

[arun@MacBook-Pro-2 ~/aks/wspace] $ pip install credstash
You are using pip version 6.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting credstash
  Using cached credstash-1.12.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pycrypto>=2.6.1 in /Library/Python/2.7/site-packages (from credstash)
Collecting boto3>=1.1.1 (from credstash)
  Using cached boto3-1.4.2-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): jmespath<1.0.0,>=0.7.1 in /Library/Python/2.7/site-packages (from boto3>=1.1.1->credstash)
Collecting botocore<1.5.0,>=1.4.1 (from boto3>=1.1.1->credstash)
  Using cached botocore-1.4.87-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.0 (from boto3>=1.1.1->credstash)
  Using cached s3transfer-0.1.10-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.5.0,>=1.4.1->boto3>=1.1.1->credstash)
  Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
Collecting docutils>=0.10 (from botocore<1.5.0,>=1.4.1->boto3>=1.1.1->credstash)
  Using cached docutils-0.13.1-py2-none-any.whl
Collecting futures<4.0.0,>=2.2.0 (from s3transfer<0.2.0,>=0.1.0->boto3>=1.1.1->credstash)
  Using cached futures-3.0.5-py2-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.5.0,>=1.4.1->boto3>=1.1.1->credstash)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, docutils, botocore, futures, s3transfer, boto3, credstash
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) 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 six-1.4.1:
      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/install.py", line 352, in run
          root=options.root_path,
        File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 687, in install
          requirement.uninstall(auto_confirm=True)
        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: '/var/folders/z5/37m4q63j3bn48y3dxgf40tdm0000gn/T/pip-LMRqSS-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

如果我在上述命令中没有使用 sudo,则会收到以下异常错误:

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/concurrent'

要获取最新的 pip,因为 pip 是通过 macOS 上的 python 提供的,如果我尝试使用 brew 安装 python,我会得到以下信息,我会深入探讨如何首先删除 Xcode:

$ brew install python
Error: Your Xcode (5.0.2) is too outdated.
Please update to Xcode 8.2 (or delete it).
Xcode can be updated from the App Store.

$ pip --version
pip 6.1.1 from /Library/Python/2.7/site-packages (python 2.7)

因为我认为我有一个较旧的 pip 版本,所以我下载了这个文件:

$ wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py 

成功安装了更新版本的 pip。现在显示:

$ pip --version
pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)

尝试执行 pip install credstash 但仍然出现相同的错误(使用或不使用 sudo)。

【问题讨论】:

    标签: macos pip homebrew credstash


    【解决方案1】:

    如果您尝试安装到系统 Python,那么您需要 sudo。如果您只想玩玩,请考虑创建一个 virtualenv 并安装在那里。 http://docs.python-guide.org/en/latest/dev/virtualenvs/

    【讨论】:

    • 太棒了,我从来没有机会玩 virtualenv 但现在我一定会试试的。
    • 这对我有用 sudo -H pip install credstash 在 OSX 上
    【解决方案2】:

    我尝试了以下方法来安装 credstash

    从这里下载 Python3 Mac 二进制文件。

    https://www.python.org/ftp/python/3.5.2/python-3.5.2-macosx10.6.pkg
    

    安装了.pkg文件的GUI方式。

    在 Mac 中打开了一个终端窗口。

    [arun@MacBook-Pro-2 /tmp] $ which pip
    /usr/local/bin/pip
    
    [arun@MacBook-Pro-2 /tmp] $ pip --version
    pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)
    
    [arun@MacBook-Pro-2 /tmp] $ which python
    /usr/bin/python
    
    [arun@MacBook-Pro-2 /tmp] $ python --version
    Python 2.7.10
    
    [arun@MacBook-Pro-2 /tmp] $ which python3
    /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
    
    [arun@MacBook-Pro-2 /tmp] $ python3 --version
    Python 3.5.2
    
    [arun@MacBook-Pro-2 /tmp] $ which pip3
    /Library/Frameworks/Python.framework/Versions/3.5/bin/pip3
    
    [arun@MacBook-Pro-2 /tmp] $ pip3 --version
    pip 8.1.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
    [arun@MacBook-Pro-2 /tmp] $ 
    
    [arun@MacBook-Pro-2 /tmp] $ pip3 install credstash
    Collecting credstash
      Using cached credstash-1.12.0.tar.gz
    Collecting pycrypto>=2.6.1 (from credstash)
      Using cached pycrypto-2.6.1.tar.gz
    Collecting boto3>=1.1.1 (from credstash)
      Using cached boto3-1.4.2-py2.py3-none-any.whl
    Collecting s3transfer<0.2.0,>=0.1.0 (from boto3>=1.1.1->credstash)
      Using cached s3transfer-0.1.10-py2.py3-none-any.whl
    Collecting botocore<1.5.0,>=1.4.1 (from boto3>=1.1.1->credstash)
      Using cached botocore-1.4.87-py2.py3-none-any.whl
    Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.1.1->credstash)
      Using cached jmespath-0.9.0-py2.py3-none-any.whl
    Collecting docutils>=0.10 (from botocore<1.5.0,>=1.4.1->boto3>=1.1.1->credstash)
      Downloading docutils-0.13.1-py3-none-any.whl (536kB)
        100% |████████████████████████████████| 542kB 1.3MB/s 
    Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.5.0,>=1.4.1->boto3>=1.1.1->credstash)
      Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
    Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.5.0,>=1.4.1->boto3>=1.1.1->credstash)
      Using cached six-1.10.0-py2.py3-none-any.whl
    Installing collected packages: pycrypto, docutils, six, python-dateutil, jmespath, botocore, s3transfer, boto3, credstash
      Running setup.py install for pycrypto ... done
      Running setup.py install for credstash ... done
    Successfully installed boto3-1.4.2 botocore-1.4.87 credstash-1.12.0 docutils-0.13.1 jmespath-0.9.0 pycrypto-2.6.1 python-dateutil-2.6.0 s3transfer-0.1.10 six-1.10.0
    You are using pip version 8.1.1, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    [arun@MacBook-Pro-2 /tmp] $ 
    [arun@MacBook-Pro-2 /tmp] $ which credstash
    /Library/Frameworks/Python.framework/Versions/3.5/bin/credstash
    [arun@MacBook-Pro-2 /tmp] $
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-13
      • 2014-11-23
      • 2018-02-06
      • 2016-09-27
      • 2018-05-26
      • 1970-01-01
      相关资源
      最近更新 更多