简体   繁体   中英

Install python package from bitbucket in non-editable mode

I'm trying to install a python package from a private bitbucket repository into a virtual env, but pip does not seem to install any files. When using the following command ( norman is the package's name):

pip3 install git+ssh://git@bitbucket.org/mycompany/myrepo.git@develop#egg=norman

the installation is successful but there is no norman folder in venv/lib/python3.6/site-packages/ , so it seems that nothing was installed, even if venv/lib/python3.6/site-packages/norman=0.1.0.dist-info is indeed there.

Yet, the installation works perfectly using a tar.gz archive made with python3 setup.py sdist then installing with pip3 install path_to_norman.tar.gz .

Following these indications , I also tried to install the package in editable mode :

pip3 install -e git+ssh://git@bitbucket.org/mycompany/myrepo.git@develop#egg=norman

This worked fine and installed the files (in venv/src ), but I'd prefer installing it in non-editable mode. What should I do to make the installation work in non-editable mode ?

The problem came from python __init__.py files which were not included in the remote repo, so the package installed by pip3 install git+ssh... was actually empty.

When building the archive on a local machine, they were obviously there, and when using -e option, as the whole repo is downloaded, the python scripts were there anyway.

When not using -e , from what I understand, pip creates a temporary local download of the files available and then builds the package normally. Since init files were not downloaded, python scripts were not recognized by setuptools , thus an empty package was installed.

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