简体   繁体   中英

pip install private package

I have one python package A which has depends on another private package named godot(hosted at bitbucket, and should be accessed by git+ssh protocol). In package A's setup.py, I have following code:

...
install_requires=['godot'],
dependency_links=['git+ssh://git@bitbucket.org/xxx/godot.git#egg=godot']
...

I have two questions here:

  1. Now setuptools 1.4 (latest stable version) does not support 'git+ssh' protocol, only code in the development branch handle this protocol: Python setuptools: How can I list a private repository under install_requires? . I have installed the development version via:

    pip install --upgrade --force-reinstall hg+https://bitbucket.org/pypa/setuptools#egg=setuptools

    I almost solved this bit, but I wonder If any other approach available? Invoke pip install -r requirements.txt(have git+ssh://git@bitbucket.org/xxx/godot.git#egg=godot list in requirements.txt)?

  2. The second question is name conflict. There is another package on pypi also named godot, So when I install package A using follow command, pip install the godot from pypi index:

    pip install git+ssh://git@pypi.corp.com/xxx/A.git#egg=A

    How could force pip(setup.py) to install the private godot package, rather than the one on pypi index?

For part 1: you can install packages via pip by specifying as:

$ pip install http://my.package.repo/SomePackage-1.0.4.zip

To keep it simple and avoid spending undue time on it, I would just download the .zip source file and install via pip as above.

See here ...

For part 2: pip has a --no-dependencies switch. Add that after installing all the dependencies manually

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM