I have a setup code in python using setuptools, and I have the python code to install in /usr/share/mypackage (owned by root), but I'm trying to install the package as a non-privileged user. So, I create a virtual environment (with virtualenv
) in a directory $ENVDIR
owned by the user. Then, after activating the virtual environment (with source $ENVDIR/bin/activate
), I run python /usr/share/mypackage/setup.py install
.
The problem is that running setup.py install
tries to create a package.egg-info (or something like that) file inside /usr/share/mypackage
, which obviously triggers a permission denied error unless I run the setup as root, which is not what I need...
So, the question is: How can I fix this without running setup.py as root? That is, how can I prevent setup.py from writing to /usr/share/mypackage?