5

I tried to install a python module (treetager-python) by using the command:

python3 setup.py install

When trying this, I get the error:

running install
running bdist_egg
running egg_info
creating treetagger.egg-info
error: could not create 'treetagger.egg-info': Permission denied

I read about using the flag --user, but this is not working at all:

python3 setup.py install --user
running install
error: can't combine user with prefix, exec_prefix/home, or install_(plat)base

I know that using sudo would probably solve this, but I don't like to execute 3rd party files/code with root permissions.

So is there any way to solve this without using 'sudo'?

I tried this on Mac OS, just let me know if I there is any additional information needed.

Thanks in advance!

SOLUTION: So as the answer suggests the problem was a permission problem in the source folder. As I downloaded this the file owner was set to 'root', changing the owner using chown solved the problem. Thanks for the quick help!

MBT
  • 21,733
  • 19
  • 84
  • 102

1 Answers1

14

go to the folder contains setup.py and execute sudo chmod -R 777 folder_name. I hope this will help.

Fujiao Liu
  • 2,195
  • 2
  • 24
  • 28
  • Great, thanks for this advice! Actually it wasn't this, but then i noticed the file had the owner root, so changing the owner using chown solved the problem. Maybe you could add this to your answer, so this will help others as well! – MBT May 10 '17 at 17:19
  • `sudo chmod -R 777 .` did the magic for me – Victor Zuanazzi Mar 23 '21 at 10:43