加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – AttributeError:module’pkg_resources’没有属性’s

发布时间:2020-12-20 11:54:56 所属栏目:Python 来源:网络整理
导读:我正在尝试安装tweepy(并通过扩展oauthlib),并且在尝试安装时遇到以下错误: Collecting requests-oauthlib=0.4.1 (from tweepy)Using cached requests_oauthlib-0.7.0-py2.py3-none-any.whlCollecting oauthlib=0.6.2 (from requests-oauthlib=0.4.1-tweepy
我正在尝试安装tweepy(并通过扩展oauthlib),并且在尝试安装时遇到以下错误:

Collecting requests-oauthlib>=0.4.1 (from tweepy)
Using cached requests_oauthlib-0.7.0-py2.py3-none-any.whl
Collecting oauthlib>=0.6.2 (from requests-oauthlib>=0.4.1->tweepy)
  Using cached oauthlib-2.0.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>",line 1,in <module>
  File "/private/var/folders/t7/751h0y1102z99ysr6659yjcr0000gn/T/pip-build-aoklhwtw/oauthlib/setup.py",line 70,in <module>
    'Topic :: Software Development :: Libraries :: Python Modules',File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py",line 108,in setup
    _setup_distribution = dist = klass(attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/dist.py",line 263,in __init__
    self.patch_missing_pkg_info(attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/dist.py",line 246,in patch_missing_pkg_info
    key = pkg_resources.safe_name(str(attrs['name'])).lower()
AttributeError: module 'pkg_resources' has no attribute 'safe_name'

有趣的是,/ private / var / folders / t7 / 751h0y1102z99ysr6659yjcr0000gn / T / pip-build-aoklhwtw / oauthlib /文件夹不存在,所以我可以
甚至删除/看得更近.

可能导致这种情况的任何想法?

解决方法

找到了解决方案.我不得不升级setuptools,所以:

$sudo pip3 install --upgrade setuptools

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读