8

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)? Commented May 2, 2017 at 21:23
  • 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. Commented May 2, 2017 at 21:32

2 Answers 2

15

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

python setup.py install --user
Sign up to request clarification or add additional context in comments.

2 Comments

I already tried it. It gives the same error: error: [Errno 13] Permission denied: 'srm.egg-info/PKG-INFO'
This worked for me. I couldn't install xgboost from source using python (python setup.py install) because the python script didn't have permission to create a folder. If I tried installing with sudo, python returned ImportError: No module named setuptools, even though I have setuptools installed. Specifying the flag --user and running install without sudo solved the issue.
7

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.

1 Comment

So easily done, I did exactly the same thing. You've just saved me a load of time - thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.