Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 293
bogtan Avatar asked Jun 01 '12 09:06

bogtan


People also ask

What directory does Python install packages?

Locally installed Python and all packages will be installed under a directory similar to ~/. local/bin/ for a Unix-based system, or \Users\Username\AppData\Local\Programs\ for Windows.

How do I install Python packages in GitHub?

To install Python package from github, you need to clone that repository. pip install . from the locally cloned repo dir will work too.

What is dist Info folder Python?

dist-info : a directory of files containing information about the package, such as a metadata file with information such as the package's author and what versions of Python it supports (METADATA), a license file (LICENSE), a file specifying what tool was used to install the package (INSTALLER), and more.


2 Answers

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
like image 60
jpic Avatar answered Oct 06 '22 05:10

jpic


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

like image 36
bogtan Avatar answered Oct 06 '22 07:10

bogtan