Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are site-packages in python and can you install/use them if you aren't root?

Tags:

python

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?

like image 695
Gabriel Southern Avatar asked Apr 24 '12 04:04

Gabriel Southern


1 Answers

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.

like image 88
Eric Drechsel Avatar answered Sep 30 '22 14:09

Eric Drechsel