单元测试安装错误找不到满足要求的版本 [英] unittest installation error Could not find a version that satisfies the requirement

查看:23
本文介绍了单元测试安装错误找不到满足要求的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能帮我纠正一下这个错误信息吗:

Could not find a version that satisfies the requirement unittest
我安装了最新的PythonPyCharm,并尝试安装程序包unittest,但收到上述错误。到目前为止,我对Python的体验有点像DLL地狱...

推荐答案

如果您尝试此操作:

$ pip install unittest
Collecting unittest

  Could not find a version that satisfies the requirement unittest (from versions: )
No matching distribution found for unittest
出现错误是正常的,因为unittest不是Pypi上的有效包。唯一的可分发文件是unittest2-0.0.0.tar.gz,但名称不正确,它应该是unittest-0.0.0.tar.gz(不包括&2&q;)。事实上,我认为这是一个错误,如果你想使用这个,你需要安装unittest2(它是unittest的一个后端)。

unittest是标准模块,不需要安装

$ python -m unittest

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

这篇关于单元测试安装错误找不到满足要求的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆