This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: error: [Errno 13] Permission denied: '/usr/local/lib/python3.7/lib2to3/'
Type: Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.7
Status: closed Resolution: duplicate
Dependencies: Superseder: Source installation sets incorrect permissions for
View: 15317
Assigned To: Nosy List: bunhin, xtreak
Priority: normal Keywords:

Created on 2019-03-16 09:03 by bunhin, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg338069 - (view) Author: Bun Hin (bunhin) Date: 2019-03-16 09:03
I get this error while installing some packages with pip3 inside an environment

using centOS 7 with python 3.7.2 as parallel install.
step to reproduce: (dependancies are installed)

rm -rf /usr/local/lib/python3.7
cd /root/
tar -xzf Python-3.7.2.tgz
cd Python-3.7.2
./configure --prefix=/usr/local --enable-shared --enable-optimizations LDFLAGS="-Wl,-rpath /usr/local/lib"
make altinstall

adduser a-user

su - a-user
/usr/local/lib/python3.7 -m venv user-envn
source user-envn/bin/activate

pi3 install --upgrade pip
pip install pyusb==1.0.0

result with error:

Collecting pyusb==1.0.0
  Using cached
    Complete output from command python egg_info:
    running egg_info
    creating pip-egg-info/pyusb.egg-info
    writing pip-egg-info/pyusb.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/pyusb.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/pyusb.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/pyusb.egg-info/SOURCES.txt'
    error: [Errno 13] Permission denied: '/usr/local/lib/python3.7/lib2to3/'

please help how to solve this
msg338071 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-03-16 09:22
configure and make run as root might cause this. See also issue15317 that is a similar report for source install.
msg338073 - (view) Author: Bun Hin (bunhin) Date: 2019-03-16 09:36
is there any better way to configure other than as root? because this python3.7 may be used by other user too

in a more strict environment,  compile it other than root (sudo) may not be allowed also.

using a user  may have permission issue as well right?  i am not sure here
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80494
2021-10-20 23:03:54gregory.p.smithsetstatus: open -> closed
superseder: Source installation sets incorrect permissions for
resolution: duplicate
stage: resolved
2019-03-16 09:36:24bunhinsetmessages: + msg338073
2019-03-16 09:22:02xtreaksetnosy: + xtreak
messages: + msg338071
2019-03-16 09:03:54bunhincreate