【问题标题】:How to install PIL to Python 3.5 on a mac?如何在 Mac 上将 PIL 安装到 Python 3.5?
【发布时间】:2016-03-10 23:20:27
【问题描述】:

我对 Python 安装非常陌生,正在尝试安装 PIL。我有一种感觉,它们被安装到了错误的目录中。 PIP 似乎安装得很好。

Pycharm 说

Try to run this command from the system terminal. Make sure that you
use the correct version of 'pip' installed for your Python interpreter
located at
'/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'.

但是在终端签入时回复是

Jamess-MacBook-Pro:~ JamesParsons$ pip install Pillow
Requirement already satisfied (use --upgrade to upgrade): Pillow in
/Library/Python/2.7/site-packages

它还提到了不同版本的 Python。

如何安装 PIL 的最佳方式是 Pycharm 仍然提供未解决的参考?

【问题讨论】:

    标签: python macos python-imaging-library


    【解决方案1】:

    在你的命令行上:

    $ which python
    

    我打赌这会返回:

    /Library/Python/2.7/site-packages

    这显示了您的“基本”Python(预装在 Mac 上)的位置。现在做:

    $ which python3
    

    如果这表明:

    /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'

    然后检查pip3 版本:

    $ which pip3
    

    如果存在并且与python3 有相似的位置,那么试试这个:

    $ pip3 install Pillow
    

    如果 有效,那么 PyCharm 现在很有可能会选择正确的安装。

    【讨论】:

      猜你喜欢
      • 2018-05-24
      • 1970-01-01
      • 2019-05-19
      • 1970-01-01
      • 2012-02-22
      • 2019-10-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多