I successfully installed tweepy2 with Python 3.4 on Windows 7. But when I type import tweepy
(in the command line of Python) it gives me this message:
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tweepy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\site-packages\tweepy-2.3-py3.4.egg\tweepy\__init__.py", line 12, in <module>
File "C:\Python34\lib\site-packages\tweepy-2.3-py3.4.egg\tweepy\models.py", line 5, in <module>
File "C:\Python34\lib\site-packages\tweepy-2.3-py3.4.egg\tweepy\utils.py", line 6, in <module>
ImportError: cannot import name 'quote'
How can I solve that error?
The Tweepy package is not Python 3 compatible . It will only work with Python 2.
The line that fails is:
from urllib import quote
which is only available in that location on Python 2. The package documentation clearly states this too:
Note only Python 2.6 and 2.7 are supported at the moment. The Python 3 family is not yet supported.
You'll have to use a different package to interface with Twitter. The Twitter Developer documentation lists several options:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.