tox 无法在 D:\python27 路径中检测到 python 解释器 [英] tox can't detect python interpreter in D:\python27 path
问题描述
我的 tox.ini 文件是这样的
My tox.ini file looks like this
[tox]
envlist=py27
[testenv]
deps=
pytest
这无法找到位于 D:\python27 而不是标准 c:\python27 位置的我的基本 python 安装
This fails to find my base python installation which is at D:\python27 and not the standard c:\python27 location
如果我将 tox.ini 更改为这个,它可以工作但看起来很丑.
If I change tox.ini to this, it works but looks ugly.
[tox]
envlist=cpy27,dpy27
skip_missing_interpreters=True
toxworkdir={toxinidir}/build/tox
[testenv]
basepython=
cpy27: C:\Python27\python.exe
dpy27: D:\Python27\python.exe
deps=
pytest
所以我的问题是,如何配置 tox 以便它可以确定 python 安装在 Windows 机器上的位置,而无需明确指定路径,因为每个开发人员可能已将其安装在其机器上的不同路径中.
so my question, how can I configure tox so it can figure out where python is installed on the windows machine, w/o explicitly specifying the paths as each developer may have it installed it in a different path on their machine.
推荐答案
我想通了.看起来我需要为 windows 指定 python2.7 而不是 py27
I figured this out. looks like I need to specify python2.7 instead of py27 for windows
[tox]
envlist=python2.7
无论是 C 盘还是 D 盘,这都能正确检测 python 的位置.
This correctly detects the location of python irrespective of C or D drive.
这篇关于tox 无法在 D:\python27 路径中检测到 python 解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!