python中的VitualEnv:拒绝访问

python中的VitualEnv:拒绝访问,python,virtualenv,Python,Virtualenv,我使用python 2.7.11、3.4.3、3.5.1运行Windows 8.1。路径中只添加了python 2.7。我正在尝试使用cmd中的以下命令创建虚拟环境(具有管理权限) 它会导致以下错误 Running virtualenv with interpreter B:\Apps\Python\2.7 Traceback (most recent call last): File "b:\apps\python\2.7\lib\runpy.py", line 162, in _run_mo

我使用python 2.7.11、3.4.3、3.5.1运行Windows 8.1。路径中只添加了python 2.7。我正在尝试使用cmd中的以下命令创建虚拟环境(具有管理权限)

它会导致以下错误

Running virtualenv with interpreter B:\Apps\Python\2.7
Traceback (most recent call last):
File "b:\apps\python\2.7\lib\runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name)
File "b:\apps\python\2.7\lib\runpy.py", line 72, in _run_code exec code in run_globals
File "B:\Apps\Python\2.7\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "b:\apps\python\2.7\lib\site-packages\virtualenv.py", line 665, in main popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
File "b:\apps\python\2.7\lib\subprocess.py", line 710, in __init__ errread, errwrite)
File "b:\apps\python\2.7\lib\subprocess.py", line 958, in _execute_child startupinfo)
WindowsError: [Error 5] Access is denied
或者这个命令,

virtualenv -p B:\Apps\Python\2.7\python.exe sympy2.7   
导致

New python executable in A:\Programming\Open Source\Sympy\environments\sympy2.7\Scripts\python.exe
ERROR: The executable "A:\Programming\Open Source\Sympy\environments\sympy2.7\Scripts\python.exe" could not be run: [Error 5] Access is denied

谁能帮我排除故障。

这是virtualenv中的一个错误,因为路径中有空格。它错误地引用了新创建的
python.exe
的路径,导致找不到它


是问题的解决方案,但解决方法是只在没有空格的路径中创建虚拟环境。

这是virtualenv中的一个错误,因为路径中有空格。 在没有任何空间的情况下,将整个路径连接到环境
例如:E:\Works\project_2017对我来说,解决方案是引用可执行文件而不是文件夹。“访问被拒绝”错误消息具有误导性

C:\Installs\Python_3.8>virtualenv -p C:\Installs\Python_3.8 tensorflow_env
# Output: RuntimeError: failed to query C:\Installs\Python_3.8 with code 13 err: 'Access is denied'

C:\Installs\Python_3.8>virtualenv -p C:\Installs\Python_3.8\python.exe tensorflow_env
# Output: created virtual environment CPython3.8.0.final.0-64 in 2504ms

使用此命令
virtualenv-p“B:\Apps\Python\2.7 sympy2.7”

New python executable in A:\Programming\Open Source\Sympy\environments\sympy2.7\Scripts\python.exe
ERROR: The executable "A:\Programming\Open Source\Sympy\environments\sympy2.7\Scripts\python.exe" could not be run: [Error 5] Access is denied
C:\Installs\Python_3.8>virtualenv -p C:\Installs\Python_3.8 tensorflow_env
# Output: RuntimeError: failed to query C:\Installs\Python_3.8 with code 13 err: 'Access is denied'

C:\Installs\Python_3.8>virtualenv -p C:\Installs\Python_3.8\python.exe tensorflow_env
# Output: created virtual environment CPython3.8.0.final.0-64 in 2504ms