pip安装软件

环境:macOS Sierra 10.12.6

工具:pycharm 2017.3.2

sudo easy_install pip

出现错误,于是用另一种方法安装

还是会出现问题

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/0t/t7t2dpdx1xb825__kxqdl26h0000gn/T/pip-build-JwqJfi/pyqrcode/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/0t/t7t2dpdx1xb825__kxqdl26h0000gn/T/pip-LvXj4Y-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0t/t7t2dpdx1xb825__kxqdl26h0000gn/T/pip-build-JwqJfi/pyqrcode/

参考https://stackoverflow.com/questions/31498495/error-when-installing-using-pip

输入命令

sudo pip install -U setuptools

依旧报错

The directory '/Users/imac/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/imac/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.

最后用以下命令行解决

sudo -H pip install itchat

itchart替换成你要安装的软件名称就可以了。

原文地址:https://www.cnblogs.com/qianyindichang/p/8311651.html