1

LinkedInネットワークをダウンロードして、Gephi内で分析できるようにするために、LinkedInに対して認証するPythonツールを実行しようとしています。私はここでそのようなファイルを入手しました:

githubのlinkedin-1-oauth.py

私はそれと彼が要点に持っている他の2つのファイルのクローンを作成しました。git clone [url here]3つのファイルすべてに対して実行するだけで、端末からこれを実行しました。APIと秘密鍵を対応する場所に配置します。

私はここで提案されているようpip install oauth2に更新httplib2しました:

pip install oauth2 and update httplib2

また、コマンドラインからこれを実行しました。コマンドラインは、gistからlinkedinファイルをダウンロードした場所と同じディレクトリにファイルをダウンロードしてインストールしました。すべてユーザーフォルダーにあります。

pip install oauth2次のエラーメッセージを表示しようとすると、次のようになります。

Downloading/unpacking oauth2
  Running setup.py egg_info for package oauth2

Requirement already satisfied (use --upgrade to upgrade): httplib2 in /usr/lib/python2.7/dist-packages (from oauth2)
Installing collected packages: oauth2
  Running setup.py install for oauth2
    error: could not create '/usr/local/lib/python2.7/dist-packages/oauth2': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/steven/build/oauth2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-e2RkcV-record/install-record.txt:
    running install

running build

running build_py

running install_lib

creating /usr/local/lib/python2.7/dist-packages/oauth2

error: could not create '/usr/local/lib/python2.7/dist-packages/oauth2': Permission denied

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/steven/build/oauth2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-e2RkcV-record/install-record.txt failed with error code 1
Storing complete log in /home/steven/.pip/pip.log

次に試しeasy_install oauth2てみたところ、次のエラーメッセージが表示されました。

error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-4349.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.7/dist-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  http://packages.python.org/distribute/easy_install.html

Please make the appropriate changes for your system and try again.

それでやってsudo apt-get install oauth2みましたが見つかりませんでした

私はUbuntu12.04LTSを実行しています。今朝何かをする前に、すべてのsudoの更新とアップグレードを行いました。私はPython2.7を実行しています

ありがとうございました

4

3 に答える 3

3

ここに行くことで問題を解決することができました:

python-oauth2

于 2013-03-24T15:34:56.480 に答える
1

Windowsにpythonoauth2ライブラリをインストールする手順

  1. http://python-distribute.org/distribute_setup.pyをダウンロードし、Pythonがインストールされている場所にコピーします
  2. 「pythondistribute_setup.py」を実行します
  3. Oauth2をダウンロードしてディレクトリに解凍します。このディレクトリに移動します。
  4. 「pythonsetup.pyinstall」を実行してouath2をインストールします
于 2013-06-02T16:27:47.617 に答える
0

Python 2.7.10以降を使用している場合は、ここでより簡単な方法を使用できます。'pip'を使用してPythonモジュールをインストールします。私の場合、ウィンドウズで次のように言ってください。C:\ Python27 \ Scripts \ pip install ouath2

于 2016-04-16T08:55:04.963 に答える