简体   繁体   中英

Python virtual environment creation error(Permission Error 13)

I know this has been asked several times; however I'm yet to see a topic using the Windows (Windows 10, FYI) Command console and actually being resolved

So, the problem starts when I try to create a new virtual environment from the CMD in a certain folder which is called web_scraper , I have successfully installed the latest version of pip and I have Python 3.6.1; also, I've created another virtual environment before and even installed Flask in it, and yes, also did a successful mini-try in the localhost.

When I type this into the CMD to create a new venv, this happens:

C:\Users\Nilor2000\Desktop\Proyectos\web_scraper>virtualenv venv

...[lots of yadayada that all comes down to this:]

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Nilor2000\\Desktop\\Proyectos\\web_scraper\\venv\\lib\\os.py'

Now, this is the interesting part , since I use PyCharm to code, it automatically creates a venv folder for every new project, which contains everything for a virtual environment, so I did a separate test folder, copied the venv folder which comes by default and it was then that I had to just activate it, not create it. And it was there with that "default" venv folder that I could run the localhost test and install Flask.

So, my final question is: What is wrong with my system that won't allow me to create a new virtual environment ?

  • I have the rights of admin

  • Already installed everything I need to create and run venv s

  • Yes, I already ran the CMD as admin, didn't work

Please, someone help, I don't want to copy and paste the same venv folder for every project :(

/-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-//-/-/-/-/-/-/-/

EDIT

So, if somebody is facing a similar problem and can't create a new virtualenv but has pip and the virtualenv resource installed, you can download it separately.

I've created a GitHub repository for that particular case, It's this one

If you decide to use it, please let me know if it works :)

I had the same error message. I created the virtualenv from a batch script. Running it gave me the [Errno 13] message.

I noticed that the virtualenv was already created so the new one was denied.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM