在另一个驱动器上创建一个 virutalenv - 访问被拒绝 [英] Create a virutalenv on another drive - Access is denied

查看:41
本文介绍了在另一个驱动器上创建一个 virutalenv - 访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在我的主驱动器 (C:\) 上创建虚拟环境时,它工作正常,但在我的第二个磁盘 (E:\) 上,我收到一条错误消息:

When trying to create a virtual env on my main drive (C:\) it works fine, but on my second disk (E:\) I get a error saying:

错误:无法执行可执行文件E:\path\env\Scripts\python.exe"运行:[WinError 5] 访问被拒绝.

ERROR: The executable "E:\path\env\Scripts\python.exe" could not be run: [WinError 5] Access is denied.

我使用的命令是:

C:\WINDOWS\system32>virtualenv "E:\项目路径\env"

C:\WINDOWS\system32>virtualenv "E:\path to project\env"

E:\项目路径>virtualenv env

E:\path to project>virtualenv env

它确实创建了文件夹,但看起来当它尝试运行 python 来安装它失败的 virtualenv 的所有要求时.

It does create the folder, but it looks like when it's trying to run python to install all of the requirement for the virtualenv it fails.

我使用的是 python 3.5,它安装在 C:\ 上的默认位置.

I'm using python 3.5 which is installed at its default location on C:\.

  • 我尝试使用另一个版本 (3.4).
  • 以管理员身份运行命令.
  • 制作符号链接并从那里创建环境.
  • 从 c:\运行命令

似乎没有任何效果.

我有点想不通了.那些人有同样的问题或解决方案?不得不在我的 c:\ 上工作有点烦人,因为它几乎没有空间了.

I'm kind of out of ideas. Those anybody have the same problem or a solution? It's kind of annoying having to work on my c:\ as it's almost out of space.

推荐答案

在上面的评论中引用 Eryk Sun 的话,我想我会把他的答案放在这里,因为它应该是公认的解决方案:

To quote Eryk Sun in the comment above, I thought I would put his answer here because it should be the accepted solution:

python -m venv E:\path to project\env

这篇关于在另一个驱动器上创建一个 virutalenv - 访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆