7
votes

I have a project with some structure, it is console script. The project has setup.py file.

All I want is to install my package any way without using sudo. I spent like 10 hours browsing the internet and can't find a working solution.

I keep getting error: [Errno 13] Permission denied: 'srm.egg-info/PKG-INFO' if using virtualenv

And getting [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-27105.write-test'

It works good enough with sudo(but there are troubles with uninstall, and it is still not working with virtualenv)

Using: Ubuntu 14.04, Python 2.7,

2
What's wrong with virtualenv? Can you explain? How do you use it? Is it activated? Which version of pip (and setuptools)? - Laurent LAPORTE
I already understood the root of the problem, added it in the answer section below. What was wrong with virtualenv is that it was behaving like it is working with absolute path when I tried to install my program and it confused me. But now it all works fine. - N7D

2 Answers

11
votes

Use the parameter --user to specify your home directory:

python setup.py install --user
5
votes

Ok, so I f***ed up so much:

After using sudo, package files were created in the location of my setup.py and they had lock icon (system files because of sudo) and I could no longer install program without sudo.

My solution was to sudo rm -r all of the previously created locked files in program directory and those near python directory, and just install my program without sudo using --user or virtualenv.