简体   繁体   English

如何在python 3.2上创建虚拟环境。

[英]how to create a virtual environment on python 3.2.

You may smile when read this question, but.. I read in many places how to do this work, but I have this trouble: 阅读此问题时,您可能会微笑,但是..我在许多地方阅读了如何进行此工作,但是我遇到了麻烦:

I use a windows 7 system; 我使用Windows 7系统; I already installed python 3.2 and the module virtualenv; 我已经安装了python 3.2和virtualenv模块; when I put the instruction: virtualenv -p /usr/bin/python 3.2 当我输入指令时:virtualenv -p / usr / bin / python 3.2
it send an syntax error. 它发送语法错误。 If I put the instruction: /usr/bin/virtualenv-3.2 It send the same syntax error. 如果我输入以下指令:/usr/bin/virtualenv-3.2它发送相同的语法错误。 How do I create a virtualenv? 如何创建虚拟环境? Thanks for your help 谢谢你的帮助

I believe the problem here is the path that you specify, which is unix based and not windows 7. Try to use the path to your python interpreter location on your windows system for the -p argument. 我相信这里的问题是您指定的路径,该路径基于UNIX而不是Windows7。尝试将Windows系统上python解释器位置的路径用于-p参数。

like for example: 例如:

mkvirtualenv -p c:/your/path/to/python2.5

May I give u some additional advice/tip: 我可以给你一些其他的建议/提示:

In the past I've used virtualenvwrapper, which provides a set of function that make working with virtual environment a lot easier. 过去我使用过virtualenvwrapper,它提供了一组功能,使使用虚拟环境更加容易。 I really loved it! 我真的很喜欢它!

In order to install it, you should make sure that virtual environment is already installed, which I believe is the case for you. 为了安装它,您应该确保已经安装了虚拟环境,我相信您就是这种情况。

Next run: 下一轮:

pip install virtualenvwrapper

next you can follow the simple steps here 接下来,您可以按照简单的步骤在这里

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

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