当我尝试通过我的终端下载 pip 安装 tweepy 时,我收到此错误


copying tweepy/error.py -> build/lib/tweepy
copying tweepy/models.py -> build/lib/tweepy
copying tweepy/oauth.py -> build/lib/tweepy
copying tweepy/parsers.py -> build/lib/tweepy
copying tweepy/streaming.py -> build/lib/tweepy
copying tweepy/utils.py -> build/lib/tweepy
running install_lib
creating /Library/Python/2.7/site-packages/examples
error: could not create '/Library/Python/2.7/site-packages/examples': Permission denied
----------------------------------------

命令 "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folder/zq/k3pbc5v57gn07qqg7qxnrmm0000gn/T/pip-build-R8mYNT/tweepy/setup.py';f=getattr(tokenize, 'open', open((file(;code=f.read((.replace('\r', ''(;f.close((;exec(compile(code, file, 'exec'((" install --record/var/folder/zq/k3pbc5v57gn07qqg7qxxnrmm0000gn/T/pip-ZdPzhK-record/install-record.txt --single-version-externally-managed --compile"失败,错误代码为 1 in/private/var/folder/zq/k3pbc5v57gn07qqg7qxxnrmm0000gn/T/pip-build-R8mYNT/tweepy/

Python 安装位于您的 '/home/username/' 目录之外。您需要使用 root 权限授予您访问目录的权限。

$ sudo pip install tweety 
  • 如上所述使用 sudo 将只应用它后面的命令。

最新更新