mkonstanty
mkonstanty

Reputation: 165

python on windows 10 cannot upgrade modules in virtual environment

I has been forced to develop python scripts on Windows 10, which I have never been doing before. I have installed python 3.9 using windows installer package into C:\Program Files\Python directory. This directory is write protected against regular user and I don't want to elevate to admin, so when using pip globally I use --user switch and python installs modules to C:\Users<user>\AppData\Roaming\Python\Python39\site-packages and scripts to C:\Users<user>\AppData\Roaming\Python\Python39\Scripts directory. I don't know how he sets this weird path, but at least it is working. I have added this path to %Path% variable for my user.

Problems start, when I'm trying to use virtual environment and upgrade pip:

But then I get error:

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access denied: 'C:\Users\\AppData\Local\Temp\pip-uninstall-7jcd65xy\pip.exe' Consider using the --user option or check the permissions.

So when I try to use --user flag I get:

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

So my questions are:

When using deprecated easy_install --upgrade pip everything works fine.

Upvotes: 1

Views: 115

Answers (1)

Stian Larsen
Stian Larsen

Reputation: 23

I recently had the same issue for some other modules. My solution was simply downgrade from python 3.9 to 3.7. Or make an virtual environment for 3.7 and use that and see how it works.

Upvotes: 1

Related Questions