Python 3的tox调用失败

Python 3的tox调用失败,第1张

概述tox运行我的 Python 2.7测试,但是Python 3.4失败了.它给出了“调用失败”消息.摘录: py34 create: /home/josh/code/ezoutlet/.tox/py34ERROR: invocation failed (exit code 1), logfile: /home/josh/code/ezoutlet/.tox/py34/log/py34-0.log tox运行我的 Python 2.7测试,但是Python 3.4失败了.它给出了“调用失败”消息.摘录:

py34 create: /home/josh/code/ezoutlet/.tox/py34ERROR: invocation Failed (exit code 1),logfile: /home/josh/code/ezoutlet/.tox/py34/log/py34-0.logERROR: actionID: py34msg: getenvcmdargs: ['/usr/bin/python','-m','virtualenv','--python','/usr/bin/python3.4','py34']

然后

Traceback (most recent call last):  file "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 8,in <module>    import base64  file "/usr/lib/python3.4/base64.py",line 9,in <module>    import re  file "/usr/lib/python3.4/re.py",line 336,in <module>    import copyreg  file "/usr/local/lib/python2.7/dist-packages/copyreg/__init__.py",line 7,in <module>    raise importError('This package should not be accessible on Python 3. 'importError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.Error in sys.excepthook:Traceback (most recent call last):  file "/usr/lib/python3/dist-packages/apport_python_hook.py",line 53,in apport_excepthook    if not enabled():  file "/usr/lib/python3/dist-packages/apport_python_hook.py",line 24,in enabled    import re  file "/usr/lib/python3.4/re.py",in <module>    raise importError('This package should not be accessible on Python 3. 'importError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.Original exception was:Traceback (most recent call last):  file "/usr/local/lib/python2.7/dist-packages/virtualenv.py",in <module>    raise importError('This package should not be accessible on Python 3. 'importError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.Running virtualenv with interpreter /usr/bin/python3.4ERROR: InvocationError: /usr/bin/python -m virtualenv --python /usr/bin/python3.4 py34 (see /home/josh/code/ezoutlet/.tox/py34/log/py34-0.log)
解决方法 您需要查看错误消息的详细信息.注意失败的命令(来自第一个摘录):

cmdargs: ['/usr/bin/python','py34']

您可以使用以下方式手动运行:

/usr/bin/python -m virtualenv --python /usr/bin/python3.4 py34

假设你看到同样的错误,你的问题是使用virtualenv而不是tox.

我查看了virtualenv帮助页面,看起来这应该有效.面对可能的错误,首先要升级Python,virtualenv或其他库.

就我而言,升级virtualenv是解决方案:

pip install --upgrade virtualenv

有趣的是,这个解决方案适用于@R_404_5087@和linux.最有可能的是,当我获得virtualenv和最新版本之间存在错误修复.

总结

以上是内存溢出为你收集整理的Python 3的tox调用失败全部内容,希望文章能够帮你解决Python 3的tox调用失败所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1193577.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存