预装.我不是那台机器的sudoers列表,所以我
将Python 2.6.4构建到我的主目录中的一个子目录中.然后我
试图使用virtualenv(第一次),但得到:
$python-2.6.4/python virtualenv/virtualenv.py ENVNew python executable in ENV/bin/pythonCould not find platform dependent librarIEs <exec_prefix>ConsIDer setting $PYTHONHOME to <prefix>[:<exec_prefix>]Installing setuptools......... Complete output from command /apps/users/dspitzer/ENV/bin/python -c "#!python\"\"\"bootstrap setuptoo..." /apps/users/dspitzer/virtualen...6.egg: Could not find platform dependent librarIEs <exec_prefix>ConsIDer setting $PYTHONHOME to <prefix>[:<exec_prefix>]'import site' Failed; use -v for tracebackTraceback (most recent call last): file "<string>",line 67,in <module>importError: No module named md5----------------------------------------...Installing setuptools...done.Traceback (most recent call last): file "virtualenv/virtualenv.py",line 1488,in <module> main() file "virtualenv/virtualenv.py",line 529,in main use_distribute=options.use_distribute) file "virtualenv/virtualenv.py",line 619,in create_environment install_setuptools(py_executable,unzip=unzip_setuptools) file "virtualenv/virtualenv.py",line 361,in install_setuptools _install_req(py_executable,unzip) file "virtualenv/virtualenv.py",line 337,in _install_req cwd=cwd) file "virtualenv/virtualenv.py",line 590,in call_subprocess % (cmd_desc,proc.returncode))OSError: Command /apps/users/dspitzer/ENV/bin/python -c "#!python\"\"\"bootstrap setuptoo..." /apps/users/dspitzer/virtualen...6.egg Failed with error code 1
我应该将PYTHONHOME设定为某个值吗? (我有意命名
我的ENV“ENV”缺少一个更好的名字.)
不知道我是否可以忽略这些错误,我尝试安装鼻子
(0.11.1)进入我的ENV:
$cd nose-0.11.1/$lsAUTHORS doc/ lgpl.txt nose.egg-info/ selftest.py*bin/ examples/ MANIFEST.in nosetests.1 setup.cfgbuild/ functional_tests/ NEWS PKG-INFO setup.pyCHANGELOG install-rpm.sh* nose/ README.txt unit_tests/$~/ENV/bin/python setup.py installCould not find platform dependent librarIEs <exec_prefix>ConsIDer setting $PYTHONHOME to <prefix>[:<exec_prefix>]Traceback (most recent call last): file "setup.py",line 1,in <module> from nose import __version__ as VERSION file "/apps/users/dspitzer/nose-0.11.1/nose/__init__.py",in <module> from nose.core import collector,main,run,run_exit,runmodule file "/apps/users/dspitzer/nose-0.11.1/nose/core.py",line 3,in <module> from __future__ import generatorsimportError: No module named __future__
有什么建议?
解决方法 你真的在你的自定义python构建上运行“make install”吗?通常你会想要做类似的事情./configure --prefix=/path/to/installdir (other options)makemake install
注意前缀可以是您具有完全写入权限的任何目录,例如我经常在共享托管环境中使用$HOME / apps.
然后运行/ path / to / installdir / bin / python,而不是构建目录中的那个.这应该创建正确的变量,然后你可以安装virtualenv.可能最好使用其setup.py安装virtualenv:
cd virtualenv_source_dir/path/to/installdir/bin/python setup.py install
这可能需要首先使用相同的方法安装setuptools.
最后:
# Just to be safeexport PATH="/path/to/installdir/bin:$PATH" virtualenv ~/ENV~/ENV/bin/pip install somepackage # (and such)总结
以上是内存溢出为你收集整理的如何使用自定义构建Python创建virtualenv环境来解决此问题?全部内容,希望文章能够帮你解决如何使用自定义构建Python创建virtualenv环境来解决此问题?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)