簡體   English   中英

使用Python 3.4安裝tweepy2

[英]Installing tweepy2 with Python 3.4

我在Windows 7上成功安裝了帶有Python 3.4的tweepy2。但是,當我輸入import tweepy (在Python的命令行中)時,它會顯示以下消息:

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'

我該如何解決該錯誤?

Tweepy軟件包與Python 3不兼容 它僅適用於Python 2。

失敗的行是:

from urllib import quote

僅在Python 2上的該位置可用。 軟件包文檔也明確指出了這一點:

請注意,目前僅支持python 2.6和2.7。 尚不支持Python 3系列。

您必須使用其他程序包才能與Twitter交互。 Twitter Developer文檔列出了幾個選項:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM