简体   繁体   English

在Windows上使用两个Python安装程序运行Scons

[英]Running Scons with two Python installations on Windows

I have installed two different python versions (3.1 and 2,7) And this is now causing a headache. 我安装了两个不同的python版本(3.1和2,7),这现在令人头疼。 The default installation is the 3.1 which have the PYTHONHOME and PYTHONPATH set. 默认安装为3.1,其中设置了PYTHONHOME和PYTHONPATH。 Problem is that when I try to run scons from the 2.7 installation (via Python27/Scripts/scons.bat) I get various import errors that reference to the Python31/lib/ folder. 问题是,当我尝试从2.7安装程序运行scons时(通过Python27 / Scripts / scons.bat)时,出现各种导入错误,这些错误引用了Python31 / lib /文件夹。

Are there any good solutions for this, except changing PYTHONHOME and PYTHONPATH for the whole system. 除了更改整个系统的PYTHONHOME和PYTHONPATH之外,是否有任何好的解决方案。 Shouldn't scons be able to work with two versions of python installed? scons不能使用两个安装的python版本工作吗?

Not sure if this is a SuperUser or a SO question, but my guess that most people experienced with Python and Scons hangs here, and not in SU. 不知道这是SuperUser还是SO问题,但是我猜测大多数使用Python和Scons的人都挂在这里,而不是SU。

尝试将scons.bat脚本中的PYTHONHOMEPYTHONPATH分别设置为每个Python安装的正确值。

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

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