4

ここで何が間違っているのかわかりません:

Sun Oct 14$ pip install python-twitter
Requirement already satisfied (use --upgrade to upgrade): python-twitter in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from python-twitter)
Requirement already satisfied (use --upgrade to upgrade): simplejson in /Library/Python/2.7/site-packages (from python-twitter)
Requirement already satisfied (use --upgrade to upgrade): oauth2 in /Library/Python/2.7/site-packages (from python-twitter)
Requirement already satisfied (use --upgrade to upgrade): httplib2 in /Library/Python/2.7/site-packages (from oauth2->python-twitter)
Cleaning up...
Sun Oct 14$ python
Python 2.7.2 (default, Nov 17 2011, 13:22:48) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import twitter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named twitter
>>> 

virtualenvを実行する必要がありますか?他に何が起こっている可能性がありますか?理解不足で申し訳ありませんが、助けていただければ幸いです。

#1を編集 してtweepyを機能させようとしていますが、Python2.7の2つのバージョンがここにある可能性があります

Sun Oct 14$ pip install --upgrade tweepy
Requirement already up-to-date: tweepy in ./tweepy-1.11-py2.7.egg
Cleaning up...
Sun Oct 14$ python
Python 2.7.2 (default, Nov 17 2011, 13:22:48) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tweepy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tweepy
>>> 

Python2.7の2つのバージョンがインストールされている可能性があると思います。1つは自作とAppleのデフォルトによるものです。自作インストールでパッケージが/Library/Python/2.7/site-packagesに配置される可能性はありますか?

繰り返しますが、事前にthx

4

1 に答える 1

1

私が読んだことから、python-twitter:

Twitter が 8 月から 9 月 (2010 年) の間に停止した Basic-Auth に依存しています。API でサポートされているのは OAuth のみで、python-twitter はこれをサポートしていません。

更新:あなたが使用したのとまったく同じ方法を使用してpython-twitterをインストールしようとしましたが、それもインポートできません。いくつかの調査を行った後、私はPython Twitter Toolsに出会いました。これは python-twitter の代替品であると私は信じています。

インストールtwitterには setuptools が必要です。easy_install twitterWebからインストールするだけです。

于 2012-10-15T04:32:04.160 に答える