如何在python中安装包

时间:2015-06-29 07:10:09

标签: python git install packages

您好我是Python新手,我想安装Python-LinkedIn 为了从LinkedIn API中提取数据。

我已将文件安装到与其他所有软件包相同的目录中(包括pip)。我不确定这是不是这样做。

每当我输入:

pip install python-linkedin

它返回

SyntaxError: invalid syntax

每当我输入:

pip install git+https://github.com/ozgur/python-linkedin.git

pip clone git+https://github.com/ozgur/python-linkedin.git 

它返回

SyntaxError: invalid syntax

请帮助,我只需要知道如何开始,谢谢。

3 个答案:

答案 0 :(得分:1)

鉴于你在窗口(它看起来像)

打开命令提示符并键入

spa.factory("linkService", function() {
   var currentLink = "/myLink.html";
    /* accessor for currentLink */
    var getLink = function(){
      return currentLink;
    }; 
    return {get: getLink}; // service interface
});

例如,如果您的python安装在C:\中,并且您使用的是2.7。

[path to your python_folder]\scripts\pip.exe install [package name]

(或C:\Python27\Scripts\pip.exe install Python-LinkedIn

答案 1 :(得分:1)

就像在尝试从python解释器中安装它之前提到的jonrsharpe一样,你应该从命令行来做。 在Windows下只需按键盘上的窗口键,输入cmd并按Enter然后键入(当然如果python被添加到路径中它可以工作,如果没有,则导航到其脚本文件夹):

pip install python-linkedin

在OS X上,打开“应用程序”文件夹,然后打开“实用工具”文件夹。打开终端应用程序。

我希望这会有所帮助。玩得开心。

答案 2 :(得分:0)

安装python模块最常用的方法是PyPy。请参阅https://pypi.python.org/pypi/python-linkedin处的模块页面。它包括安装说明。

pip[versionumber].exe
相关问题