简体   繁体   English

Python虚拟环境创建错误(权限错误13)

[英]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 但是我还没有看到使用Windows(Windows 10,FYI)命令控制台的主题, 并且实际上已经解决了

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; 因此,当我尝试从CMD在某个名为web_scraper的特定文件夹中创建新的虚拟环境时,问题就开始了,我已经成功安装了最新版本的pip并安装了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. 此外,我之前创建了另一个虚拟环境,甚至在其中安装了Flask,是的,在本地主机中也成功进行了一次迷你尝试。

When I type this into the CMD to create a new venv, this happens: 当我在CMD中键入此内容以创建新的venv时,会发生以下情况:

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. 现在,这是有趣的部分 ,因为我使用PyCharm进行编码,所以它会自动为每个新项目创建一个venv文件夹,其中包含虚拟环境的所有内容,因此我做了一个单独的测试文件夹,复制了默认情况下附带的venv文件夹那时我不得不activate它, 而不是创建它。 And it was there with that "default" venv folder that I could run the localhost test and install Flask. 而且它在那里与“默认” venv ,我可以运行本地主机测试和安装瓶夹。

So, my final question is: What is wrong with my system that won't allow me to create a new virtual environment ? 所以,我的最后一个问题是:我的系统有什么问题,不允许我创建新的virtual environment

  • I have the rights of admin 我拥有管理员的权利

  • Already installed everything I need to create and run venv s 已经安装了创建和运行venv所需的一切

  • Yes, I already ran the CMD as admin, didn't work 是的,我已经以管理员身份运行了CMD,没有用

Please, someone help, I don't want to copy and paste the same venv folder for every project :( 请有人帮助,我不想为每个项目复制并粘贴相同的venv文件夹:(

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

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. 因此,如果有人面临类似的问题并且无法创建新的virtualenv 安装了pipvirtualenv资源,则可以单独下载。

I've created a GitHub repository for that particular case, It's this one 我已经为该特定案例创建了一个GitHub存储库,就是这个

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. 我从批处理脚本创建了virtualenv。 Running it gave me the [Errno 13] message. 运行它给了我[Errno 13]信息。

I noticed that the virtualenv was already created so the new one was denied. 我注意到virtualenv已经创建,因此新的被拒绝了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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