简体   繁体   English

将虚拟环境更改为其他版本的python时出错

[英]Error changing Virtual Environment to another version of python

I'm getting an error when I try to change which version of Python I use in the virtual environment: 尝试更改在虚拟环境中使用的Python版本时出现错误:

$ virtualenv -p /cygdrive/d/cygwin/lib/python3.2 test
Running virtualenv with interpreter /cygdrive/d/cygwin/lib/python3.2
Traceback (most recent call last):
   File "/usr/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 783, in main
    popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

I'm able to create a new virtual environment if I leave the default version of python. 如果我保留默认版本的python,则可以创建一个新的虚拟环境。 I only have virtual environment installed for python 2.7 and not 3.2. 我只为python 2.7而不是3.2安装了虚拟环境。 Do I have to install it for python 3.2 as well? 我是否也必须为python 3.2安装它? If so, how to I switch the default python cygwin uses to 3.2? 如果是这样,如何将默认的cygwin python切换为3.2? Sorry for the basic questions; 对不起基本问题; I'm very new to using packages and cygwin. 我对使用软件包和cygwin非常陌生。

thanks! 谢谢! -Mark -标记

These are my permissions settings 这些是我的权限设置

$ ls -la
total 25
drwxrwxr-x+ 1 Mark None    0 Sep 29 17:47 .
drwxrwxrwt+ 1 Mark None    0 Sep 29 16:50 ..
-rw-rw----  1 Mark None  380 Sep 29 17:47 .bash_history
-rwxrwxr-x  1 Mark None 1494 Sep 29 16:48 .bash_profile
-rwxrwxr-x  1 Mark None 6054 Sep 29 16:48 .bashrc
drwxrwxr-x+ 1 Mark None    0 Sep 29 17:20 .idlerc
-rwxrwxr-x  1 Mark None 1919 Sep 29 16:48 .inputrc
-rwxrwxr-x  1 Mark None 1236 Sep 29 16:48 .profile
-rw-rw----  1 Mark None    0 Sep 29 17:47 .Xauthority

Problem solved. 问题解决了。 My brain is still in Windows file structure space. 我的大脑仍在Windows文件结构空间中。 Cygwin wanted to see this: Cygwin希望看到以下内容:

$ virtualenv -p usr/bin/python3 test

and not 并不是

$ virtualenv -p /cygdrive/d/cygwin/lib/python3.2 test

Since I was pointing it someplace that it didn't have permission to access (let alone the version of Python I was looking for) it passed a permissions error. 由于我在某个地方指出它没有访问权限(更不用说我要查找的Python版本了),因此它传递了一个权限错误。 I think! 我认为!

Thanks! 谢谢! -Mark -标记

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

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