6

I am trying to install lldb in Linux to my home directory on my system (I do not have root access) and I have run into a problem with a step that was trying to create a subdirectory in /usr/lib/python2.6/site-packages

I found the line in the Makefile that sets this variable and it is:

PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages)

So it's not something that I can specify in the configure sciprt, but I can change the Makefile to cause the files to be copied to some location in my home directory. But I don't really understand what site-packages are or how I would specify that python should look in some alternative location for these files. Is this something that is possible or are there any workarounds for what I want to do?

Gabriel Southern
  • 9,602
  • 12
  • 56
  • 95

3 Answers3

9

To answer the question as stated:

site-packages is the location where 3rd party packages are installed (ie, not part of the core python distribution). On Linux you have to be root to write to it.

To solve your issue:

virtualenv is a python environment manager, which lets you for instance create your own python environments in your home directory. For an ultra-quick start with virtualenv and virtualenvwrapper (which makes virtualenv nicer to use) check out burrito.

Eric Drechsel
  • 2,694
  • 2
  • 23
  • 24
5

A possible solution that might help over all is to install virtualenv. It's a python package that helps set up some of these more annoying path redirection issues as well as gives you access to use pip and easy_install to install directly into your home directory.

That's the long route.

site-packages doesn't really mean much except for a known directory where python will look. You can change you PYTHONPATH environment variable to include other directories when you try to import. I'm not sure how you're installing, but a lot of times build processes allow you to specify a --prefix to tell the build and installation process where to actually output the files. I don't know enough about your particular case to be able to tell if that applies.

Michael
  • 2,181
  • 14
  • 14
-6

Here is the simple code

sudo apt-get install pip