Title: python 3.7 inside venv tries to write back to read-only installation directory (
Type: Stage:
Components: Installation Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ajung, xtreak
Priority: normal Keywords:

Created on 2018-07-25 14:22 by ajung, last changed 2019-07-21 07:48 by ajung.

Messages (3)
msg322357 - (view) Author: Andreas Jung (ajung) Date: 2018-07-25 14:25
I installed Python 3.7.0 from source inside /opt/python-3.7.0 (make install as root).

Then I created a virtual environment for a package and tried to develop the package.
Python 3.7.0 tries to create a file


which fails obviously because the installation directory is owned by root and is not writable for an normal user account

(my-3.7) ajung@dev ~/src/zopyx.txng3.ext (master) $ /opt/python-3.7.0/bin/python3 -m venv .

(my-3.7) ajung@dev ~/src/zopyx.txng3.ext (master) $ bin/python
Python 3.7.0 (default, Jul 25 2018, 16:08:13) 
[GCC 7.3.1 20180130 (Red Hat 7.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.

(my-3.7) ajung@dev ~/src/zopyx.txng3.ext (master) $ bin/python develop
running develop
running egg_info
writing zopyx.txng3.ext.egg-info/PKG-INFO
writing dependency_links to zopyx.txng3.ext.egg-info/dependency_links.txt
writing namespace_packages to zopyx.txng3.ext.egg-info/namespace_packages.txt
writing requirements to zopyx.txng3.ext.egg-info/requires.txt
writing top-level names to zopyx.txng3.ext.egg-info/top_level.txt
error: [Errno 13] Permission denied: '/opt/python-3.7.0/lib/python3.7/lib2to3/'
msg322364 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-07-25 15:16
Seems related :

msg348229 - (view) Author: Andreas Jung (ajung) Date: 2019-07-21 07:48
This issue is still true for 3.8.0b1, Ubuntu 19.04, umask is 0077, Python 3.8 is installed using "sudo make install".

bin/python develop
running develop
running egg_info
writing fs.webdavfs.egg-info/PKG-INFO
writing dependency_links to fs.webdavfs.egg-info/dependency_links.txt
writing entry points to fs.webdavfs.egg-info/entry_points.txt
writing requirements to fs.webdavfs.egg-info/requires.txt
writing top-level names to fs.webdavfs.egg-info/top_level.txt
error: [Errno 13] Permission denied: '/opt/python-3.8.0b1/lib/python3.8/lib2to3/Grammar3.8.0.beta.1.pickle'

So "python3 -m venv" should setup a virtualenv properly without the need writing anything to the Python installation directory. Or it is up to "make install" to generate the related files properly during installation.
Date User Action Args
2019-07-21 07:48:19ajungsetmessages: + msg348229
2018-07-25 15:16:05xtreaksetnosy: + xtreak
messages: + msg322364
2018-07-25 14:25:25ajungsetversions: + Python 3.7
messages: + msg322357
title: python 3.7 inside venv tries to write back to installation directory -> python 3.7 inside venv tries to write back to read-only installation directory (
2018-07-25 14:22:36ajungcreate