pip安装本地git仓库 [英] pip install a local git repository

查看:440
本文介绍了pip安装本地git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到使用pip将本地目录安装为python软件包的正确方法.

I can't find the correct way to install a local directory as a python package using pip.

(venv) C:\(...)>pip install . --no-index
Ignoring indexes: http://pypi.python.org/simple/
Unpacking c:\users\fsantos\desktop\biskates.com\biskates\forks\django-pipeline
  Running setup.py egg_info for package from file:///(...)%5Cforks%5Cdjango-pipeline

Installing collected packages: django-pipeline
  Running setup.py install for django-pipeline

Successfully installed django-pipeline
Cleaning up...

(venv) C:\(...)>cd ..
(venv) C:\(...)>python
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pipeline
>>> pipeline.__file__
'C:\\(...)site-packages\\pipeline\\__init__.py'
>>>

如您所见,pip刚刚复制到整个程序包中,成为站点程序包.如何避免这种情况,并直接从其源文件夹使用该软件包?

As you can see pip just copied over the package to site-packages. How can I avoid this, and use the package directly from its source folder?

我正在尝试将django-pipeline集成到我的Django项目中,但是我想首先添加对Django 1.4的支持,所以我分叉并克隆了我的fork.

I'm trying to integrate django-pipeline into my Django project, but I want to add support for Django 1.4 first, so I forked and cloned my fork.

推荐答案

我也可以使用:

cd your-local-repo
pip install -e .

python setup.py install develop

这篇关于pip安装本地git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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