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.

classification
Title: Environment variable PYTHONUSERBASE is not set during customized Python Installation
Type: security Stage:
Components: Windows Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, sarmar11, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-12-23 11:10 by sarmar11, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg358808 - (view) Author: Sara Martínez Giner (sarmar11) Date: 2019-12-23 11:10
Environment variable PYTHONUSERBASE is not set during customized Python Installation.

Python installer 3.7.6(x64) / Windows 10

Check 1: Customize the installation to install Python in C:\Python37 for all users. 
  Result: Access Denied using pip

Check 2: Check 1: Customize the installation to install Python in C:\Program Files\Python37 for all users (default). 
  Result: pip works, but error appears trying to install anything with pip. For example:
>>pip install virtualenv
 WARNING: The script virtualenv.exe is intalled in 'C:\Users\XXX\AppData\Roaming\Python\Python37\Scripts' which is not on path

By default APPDATA matches with C:\Users\XXX\AppData\Roaming
and PYHTONUSERBASE is empty

-----------------------------------------------------------------

I've found the path constructor in \Python37\Lib\site.py (_getuserbase)

So I try the following steps:
- Create folder with full control in C:\ (C:\Python)
- Set environment variable PYTHONUSERBASE=C:\Python
- Install Python for all users in C:\Python\Python37

That works for me.
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83303
2019-12-23 11:10:22sarmar11create