Install package using pip from git into site-packages

筅森魡賤 提交于 2021-02-11 14:31:14

问题


I installed a Python package using pip from git. In order to achieve this, I added the command -e git+<link>#<egg> to my requirements.txt. Pip installs this package, but not in the way I would like to have it.

First problem: I use a virtual environment. Usually, packages end up in <env>/Lib/site-packages. This one does not, it ends up in <env>/src. This makes it more to difficult to import.

Second problem: The src folder also gets created within my actual project, the one I am working on.

Both things are different to installing packages from other sources like PyPI. Is there a way to install my own packages via git in the same way? I actual built a wheel and a tar.gz, but I don't know how to install them ...


回答1:


@AnthonySottile's comment pointed me into the right direction: The -e option makes the installed package editable, which is not what I wanted. It actually works without it! So if you want to avoid having src folders appearing everywhere - download from git without the -e option: git+<link>#<egg>

Unfortunately, I didn't find any documentation for this ... so feel free to post a more profound answer or add to this one.



来源:https://stackoverflow.com/questions/63904632/install-package-using-pip-from-git-into-site-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!