1

I have had some issues installing python packages in the past when pip and apt-get have either used different install paths when installing python packages or look in different places for supporting packages.

I have recently encountered this again when installing MySQL-python using pip on my Mac but specifying the path as detailed in this solution fixed the issue.

My issue is: I don't understand why pip and apt-get use different paths and when using one or the other will cause me future issues. Can anyone explain what is going on here? Is there a good article or resource anyone can point me to? This is an issue which seems to come up regularly around here but which is not immediately obvious.

I mostly use apt-get on my production server as pip has issue with the college firewall. If I now install MySQL-python with apt-get on my production virtual environment will this cause me issues?

Thanks in advance.

Community
  • 1
  • 1
Deepend
  • 4,057
  • 17
  • 60
  • 101
  • why don't you try to download the source of the library and install it with the command line `python setup.py install --prefix=/your-path`? – Dalek Aug 14 '14 at 15:19
  • I have it installed now. My question is that I would like to understand this process and the issues better. How can I avoid similar problems in future. – Deepend Aug 14 '14 at 15:22

1 Answers1

1

A terse explanation is given on the Debian Wiki. Basically, since python is used by the system, debian and its descendants try to separate platform-distributed python modules in .deb packages (dist-packages for "debbian distribution packages") from external packages you install with, say, setup.py which go in site-packages. To keep things confusing some tools stick things in dist-packages anyway and it seems like a fair number of them end up in /usr/lib/pythonX.X/.

The debian Style Guide for Packaging Python Libraries is a good read.

tdelaney
  • 73,364
  • 6
  • 83
  • 116