0

For Python 3.8.10 under Windows 7, I changed PYTHONUSERBASE from C:\Users\Username\AppData\Roaming\Python to C:\Users\Username\AppData\Local\Python by adding a PYTHONUSERBASE environment variable and checking the output of site.getuserbase():

C:\Users\Username>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> site.getuserbase()
'C:\\Users\\Username\\AppData\\Local\\Python38\\Lib\\site-packages'
>>>

But pip won't listen and keeps storing to Roaming:

C:\>pip config set global.target C:\Users\Username\AppData\Local\Python38\Lib\site-packages
Writing to C:\Users\Username\AppData\Roaming\pip\pip.ini

How to force pip and any other component that might still be looking in Roaming to only see Local?

1 Answer 1

0

How do I set system environment variables in Windows 10?

I think you didn't set the env var correctly! I set, and it works fine!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.