【发布时间】:2016-07-26 15:27:09
【问题描述】:
在使用 Conda 创建虚拟环境时,我无法使用 Tox 运行测试。重现错误的步骤如下。
下载存储库(它很小)和cd 到它:
git clone https://github.com/opensistemas-hub/osbrain.git
cd osbrain
使用 Conda 创建虚拟环境:
conda create -n asdf python=3.5
source activate asdf
pip install tox
尝试运行测试(注意 Python 3.5 是 tox.ini 文件中设置的唯一 Python 解释器):
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?)
【问题讨论】: