在Windows上安装tweepy时出错

时间:2013-12-08 22:44:38

标签: python tweepy

我是Python和tweepy的新手。我一直试图寻找答案,但却无法使其发挥作用。

我有Java 6(不能更改为7,另一个项目),python 2.7,我已经在我的C盘中下载并提取了tweepy。

Java和python都在PATH变量中。我正在尝试安装tweepy并且我一直收到此错误。

C:\>cd C:\tweepy

C:\tweepy>python
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>setup.py build
  File "<stdin>", line 1
    setup.py build
                 ^
SyntaxError: invalid syntax
>>> setup.py install
  File "<stdin>", line 1
    setup.py install
                   ^
SyntaxError: invalid syntax
>>>

我哪里错了?这是配置问题吗?

3 个答案:

答案 0 :(得分:4)

另一种方法是使用pip(如果安装了它)。 运行

pip install tweepy

它应该可以正常工作。

答案 1 :(得分:1)

  1. 下载tweepy并将其解压缩到桌面:https://github.com/tweepy/tweepy
  2. 2.将它全部发送出去

    1. 打开命令提示符并键入&#34; cd desktop&#34;然后&#34; cd tweepy&#34;

    2. 键入&#34; python setup.py install&#34; enter image description here

答案 2 :(得分:0)

您还可以克隆git repo并执行以下操作:

git clone git://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install

注意:我假设您已将python添加到PATH变量中(如果Windows:https://www.pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/

相关问题