可以在基于conda的Python安装中使用tox吗? [英] Is it possible to use tox with conda-based Python installations?
本文介绍了可以在基于conda的Python安装中使用tox吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Python测试工具 tox
似乎旨在与virtualenv一起使用。它也可以在基于conda / anaconda的Python安装上使用吗?
The Python testing tool tox
seems to be designed to work with virtualenv. Can it also work on conda/anaconda-based Python installations?
推荐答案
虽然tox无法使用conda,但是您可以使用conda来安装 tox可以找到它们的不同Python版本(就像它将在那些文件夹中找到正常 Python安装一样)。以下内容已在Windows上进行了测试:
While tox can't make use of conda, you can use conda to "install" different Python versions where tox can find them (like it would find "normal" Python installations in those folders). The following is tested on Windows:
- 您需要通过<$ c安装的
virtualenv
$ c> pip 在根conda环境中。我怀疑这是tox将使用的virtualenv。 (我必须使用pip install virtualenv
来安装virtualenv,以使virtualenv
命令可以正常工作,即使conda list
显示为已安装。) - 安装要测试的Python版本。使用
conda create
可以轻松完成此操作。tox
将在Windows中的C:\python27
,C:\中自动检测Python二进制文件python33
等,因此请使用conda创建环境-p C:\python27 python = 2.7
等。
- You need
virtualenv
installed viapip
in the root conda environment. I suspect this is the virtualenv that will be used by tox. (I had to install virtualenv usingpip install virtualenv
to get thevirtualenv
command to work, even thoughconda list
showed it as installed.) - Install the Python versions you want to test. This is easily done using
conda create
.tox
will autodetect Python binaries on Windows inC:\python27
,C:\python33
, etc., so create environments usingconda create -p C:\python27 python=2.7
etc.
这篇关于可以在基于conda的Python安装中使用tox吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文