在 Mac 上安装 Tweepy for Python 3



我之前发布过这个问题,似乎没有人能够指导我。我想在Python 3上运行tweepy。我现在让它在Python 2上运行。

我按照此页面上的步骤操作

https://github.com/tweepy/tweepy

当我去写作时

python3 setup.py install

我收到它正在下载的消息,这显然意味着它没有正确下载。

为什么它不能在 Python 3 上正确下载?

running install
running bdist_egg
running egg_info
writing tweepy.egg-info/PKG-INFO
writing dependency_links to tweepy.egg-info/dependency_links.txt
writing requirements to tweepy.egg-info/requires.txt
writing top-level names to tweepy.egg-info/top_level.txt
reading manifest file 'tweepy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'tweepy.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
creating build/bdist.macosx-10.6-intel/egg
creating build/bdist.macosx-10.6-intel/egg/examples
copying build/lib/examples/__init__.py -> build/bdist.macosx-10.6-intel/egg/examples
copying build/lib/examples/oauth.py -> build/bdist.macosx-10.6-intel/egg/examples
copying build/lib/examples/streaming.py -> build/bdist.macosx-10.6-intel/egg/examples
creating build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/__init__.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/api.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/auth.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/binder.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/cache.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/cursor.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/error.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/models.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/parsers.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/streaming.py -> build/bdist.macosx-10.6-intel/egg/tweepy
copying build/lib/tweepy/utils.py -> build/bdist.macosx-10.6-intel/egg/tweepy
byte-compiling build/bdist.macosx-10.6-intel/egg/examples/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/examples/oauth.py to oauth.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/examples/streaming.py to streaming.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/api.py to api.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/auth.py to auth.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/binder.py to binder.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/cache.py to cache.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/cursor.py to cursor.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/error.py to error.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/models.py to models.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/parsers.py to parsers.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/streaming.py to streaming.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/utils.py to utils.cpython-36.pyc
creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying tweepy.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying tweepy.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying tweepy.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying tweepy.egg-info/requires.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying tweepy.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying tweepy.egg-info/zip-safe -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
creating 'dist/tweepy-3.6.0-py3.6.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it
removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing tweepy-3.6.0-py3.6.egg
Removing /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy-3.6.0-py3.6.egg
Copying tweepy-3.6.0-py3.6.egg to /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
tweepy 3.6.0 is already the active version in easy-install.pth
Installed /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy-3.6.0-py3.6.egg
Processing dependencies for tweepy==3.6.0
Searching for PySocks>=1.5.7
Reading https://pypi.python.org/simple/PySocks/
Download error on https://pypi.python.org/simple/PySocks/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) -- Some packages may not be found!
Couldn't find index page for 'PySocks' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) -- Some packages may not be found!
No local packages or working download links found for PySocks>=1.5.7
error: Could not find suitable distribution for Requirement.parse('PySocks>=1.5.7')

解决方案:

问题不在于tweepy,而在于python3中的认证,因此要解决此问题,请查看此链接Python 3:SSL:CERTIFICATE_VERIFY_FAILED

然后安装 tweepy 类型 python3 setup.py install

最新更新