Reputation: 669
I have a local package XYZ that I usually (sucessfully) install using:
sudo python setup.py install
Now instead of a systemwide python installation, I installed Anaconda (for OSX) in my home directory under ~/anaconda3
. Running the above command without sudo
, I expected the package to be automatically installed in ~/anaconda3/lib/python3.6/site-packages
but instead the command results in:
error: [Errno 13] Permission denied: 'XYZ.egg-info/PKG-INFO'
so apparently setup.py install
tries to write somewhere where only root has access to. Appreciate any hint on this...
I tried with sudo
. Actually by using sudo
the files do get installed in the local path. Only the owner is root. So I had to chwon
the files to myself manually. It would be nice to find out why sudo
is needed by setup.py
at all for installing in my own home folder?
Upvotes: 1
Views: 3147
Reputation: 19645
The error is because when you first ran sudo setup.py install
, the XYZ.egg_info
directory was created (in the same folder as the setup.py file) and was set to be owned by the root user. To remove this folder (and any other debris from previous installs) you can run
sudo python setup.py clean --all
or by manually removing them using, e.g., sudo rm -r XYZ.egg_info
Upvotes: 2