1

我正在尝试运行一个 python 工具来验证我对linkedin的身份,以便我下载我的linkedin网络,以便我能够在 Gephi 中对其进行分析。我在这里获得了这样一个文件:

来自github的linkedin-1-oauth.py

我克隆了那个和他在要点中的另外两个文件。我只是通过git clone [url here]对所有 3 个文件执行此操作从我的终端执行此操作。我把我的 api 和密钥放在相应的地方。

我做了一个pip install oauth2并按照这里的建议进行了更新httplib2

pip 安装 oauth2 并更新 httplib2

我也是从命令行执行此操作的,该命令行将文件下载并安装在与我从 gist 下载链接文件的位置相同的目录中,都在我的用户文件夹中。

尝试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,但找不到

我正在运行 Ubuntu 12.04 LTS,我在今天早上做任何其他事情之前完成了所有的 sudo 更新和升级。我正在运行 python 2.7

谢谢

4

3 回答 3

3

我可以通过去这里解决问题:

蟒蛇oauth2

于 2013-03-24T15:34:56.480 回答
1

windows上安装python oauth2库的步骤

  1. 下载http://python-distribute.org/distribute_setup.py并复制安装 python 的位置
  2. 运行“pythondistribute_setup.py”
  3. 下载 Oauth2 并将其解压缩到一个目录。导航到此目录。
  4. 运行“python setup.py install”安装ouath2
于 2013-06-02T16:27:47.617 回答
0

如果你有 python 2.7.10 或更高版本,这里是更简单的方法。使用 'pip' 安装 python 模块。在我的情况下,在 Windows 上说下面的伎俩。C:\Python27\Scripts\pip 安装 ouath2

于 2016-04-16T08:55:04.963 回答