使用PIP从Github安装Python软件包 [英] Installing Python Package from Github Using PIP

查看:119
本文介绍了使用PIP从Github安装Python软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到它记录了您可以通过以下方式使用pip安装Github托管Python软件包:

I've seen it documented that you can install a Github hosting Python package using pip via:

sudo pip install -e git+git://github.com/myuser/myproject.git#egg=myproject

但是,这似乎将软件包安装到当前的工作目录中,而该目录几乎永远不会存在.

However, this appears to install the package to the current working directory, which is almost never where is should be.

您如何指示pip将其安装到标准Python软件包目录中(例如,在Ubuntu上是/usr/local/lib/python2.6/dist-packages)?

How do you instruct pip to install it into the standard Python package directory (e.g. on Ubuntu this is /usr/local/lib/python2.6/dist-packages)?

推荐答案

-e标志告诉pip将其安装为可编辑",即保持源代码不变.删除-e标志,它应该可以实现您的期望.

The -e flag tells pip to install it as "editable", i.e. keep the source around. Drop the -e flag and it should do about what you expect.

sudo pip install git+git://github.com/myuser/myproject.git#egg=myproject

如果这样不起作用,请尝试使用https而不是git.

If that doesn't work try using https instead of git.

sudo pip install git+https://github.com/myuser/myproject.git#egg=myproject

这篇关于使用PIP从Github安装Python软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆