python - pip安装/usr/local/opt/python/bin/python2.7 : bad interpreter: No such file or directory

标签 python macos installation pip osx-mavericks

我不知道这是怎么回事,但我被一些 stackoverflow 解决方案卡住了,但这些解决方案一无所获。你能帮我解决这个问题吗?

  Monas-MacBook-Pro:CS764 mona$ sudo python get-pip.py
    The directory '/Users/mona/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/mona/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.
    /tmp/tmpbSjX8k/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    Collecting pip
      Downloading pip-7.1.0-py2.py3-none-any.whl (1.1MB)
        100% |████████████████████████████████| 1.1MB 181kB/s 
    Installing collected packages: pip
      Found existing installation: pip 1.4.1
        Uninstalling pip-1.4.1:
          Successfully uninstalled pip-1.4.1
    Successfully installed pip-7.1.0
    Monas-MacBook-Pro:CS764 mona$ pip --version
    -bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

最佳答案

我曾使用 home-brew 在 OS X 10.10 上安装 2.7,但新安装缺少符号链接(symbolic link)。我跑了

brew link --overwrite python

How to symlink python in Homebrew? 中所述它解决了这个问题。

关于python - pip安装/usr/local/opt/python/bin/python2.7 : bad interpreter: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31768128/

相关文章:

在 docker 中分离运行时,Python 应用程序不打印任何内容

快速显示 QLPreviewPanel

macos - 无法在 Mac OS X 10.9 上构建 Yaws

macos - 检测其他进程何时关闭 OSX

mysql - Drupal 在远程 mysql 上安装

SSL3问题,解密失败

c# - 防止在 Visual Studio 安装程序项目中自动添加依赖项

python - 如何显示使用 {% if user.is_authenticated == post.author %} 创建的帖子用户?

python - tf.where 的 TensorFlow 梯度在不应该返回 NaN 时返回 NaN

python - 'passed by assignment'是什么意思?