After installation of Python package from Git repository some folders are missing

时光毁灭记忆、已成空白 提交于 2019-12-10 14:18:35

问题


I want to install a package from the following repo https://github.com/geomin/django-countria. The command I'm using is pip install git://github.com/geomin/django-countria.git. Pip clones the repo to a temporary folder and then runs setup.py. The problem is that after installation completes, site_packages containes files countria-0.8-py2.7.egg/countria/models.py and countria-0.8-py2.7.egg/countria/__init__.py but no fixtures and locale folders. If I clone the package and run setup.py I get the same behavior.


回答1:


The reason the package misses fixtures and stuff is that there is no MANIFEST in this repo.

Try installing for development:

pip install -e git+git://github.com/geomin/django-countria.git#egg=countria

Or, clone the package and run:

pip install -e path/to/clone



回答2:


It's correct that I can install the package in development mode but since I need to work in a version control system without versioning the src/ folder I need to make it work using pip. I tried with a MANIFEST.in file but it seems that MANIFEST either is not working properly between differrent python version or it does not dirrectly affect the files to be installed. So the solution is to add the desired files in setup.py as package data ar additional files. http://docs.python.org/distutils/setupscript.html#installing-package-data Related question and answer: https://stackoverflow.com/a/3597263/812501



来源:https://stackoverflow.com/questions/10847764/after-installation-of-python-package-from-git-repository-some-folders-are-missin

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