2016-07-26 66 views
1

在使用Conda创建虚拟环境时,我无法使用Tox运行测试。重现错误的步骤如下。使用Conda和Tox运行测试时发生错误

下载资料库(这是小)和cd它:

git clone https://github.com/opensistemas-hub/osbrain.git 
cd osbrain 

与康达创建虚拟环境:

conda create -n asdf python=3.5 
source activate asdf 
pip install tox 

尝试运行测试(请注意,Python的3.5是只有Python解释器设置在tox.ini文件中):

tox 

我希望Tox能够使用Conda虚拟环境中提供的Python 3.5解释器来运行测试。但是,相反,我得到一个错误:

ERROR: The executable ~/osbrain/.tox/py35/bin/python3.5 is not 
functioning 
ERROR: It thinks sys.prefix is '/usr' (should be '~/osbrain/.tox/py35') 
ERROR: virtualenv is not compatible with this system or executable 
Running virtualenv with interpreter ~/.miniconda3/envs/asdf/bin/python3.5 

我的问题是:为什么我收到这个错误,我怎么能避免这种情况? (即:我怎样才能在本地为本项目运行测试并使用Tox?)

回答

3

我设法通过畅达来解决此通过installing virtualenv

conda install virtualenv

这不是建议的virtualenv自己使用(棒与畅达环境) 。但是,当tox在内部查找包时,它至少会找到兼容的版本。

+1

非常感谢。 conda安装virtualenv解决了我的问题。 –

相关问题