2013-07-03 100 views
0

如何在虚拟环境中安装ACtive python如何在centos虚拟环境中安装活动python

我有这样的问题,因为在这个岗位答案 https://stackoverflow.com/a/7458717/1958218

现在,通过使用在CentOS本身活跃的蟒蛇解决。 但是,对于Django,我使用的是virtualenv,我在那里遇到同样的问题。但问题是我没有活跃的python那里。

我试图激活虚拟env和再使用这个命令 /opt/ActivePython-2.6/bin/pypm install mysql-python但同样的错误

我想使用类似

/virtualenv/bin/ActivePython-2.6/bin/pypm install mysql-python 
+0

为什么不使用centos自带的常规python? – silviud

+0

@silviud因为它提取mysql-python 1.2.3,这对mysql> 5.1不起作用。但活跃的python获取最新版本。它正在工作,因为我测试了它。但是我不知道如何在virtualenv python – user1958218

+0

中使用它,当你设置virtualenv时,你可以告诉它二进制文件位于何处 - 参见-p。 – silviud

回答

0

你可以告诉VIRTUALENV哪里是你的Python解释器

Usage: virtualenv [OPTIONS] DEST_DIR 

Options: 
    --version    show program's version number and exit 
    -h, --help   show this help message and exit 
    -v, --verbose   Increase verbosity 
    -q, --quiet   Decrease verbosity 
    -p PYTHON_EXE, --python=PYTHON_EXE 
         The Python interpreter to use, e.g., 
         --python=python2.5 will use the python2.5 interpreter 
         to create the new environment. The default is the 
         interpreter that virtualenv was installed with 
相关问题