【问题标题】:unittest installation error Could not find a version that satisfies the requirementunittest 安装报错 找不到满足要求的版本
【发布时间】:2018-02-18 08:53:23
【问题描述】:

有人可以帮我解决这个错误消息吗:

Could not find a version that satisfies the requirement unittest

我安装了最新的PythonPyCharm 并尝试安装包unittest 但出现上述错误。到目前为止,我对Python 的体验有点像dll 地狱......

【问题讨论】:

  • python+windows简直就是地狱……如果你能换成linux或者mac,一切运行顺利。 ;)
  • 抱歉,我认为 Python 是真正的平台无关哈哈
  • 我使用了 Pycharm,但也尝试了 pip install unittest 通过命令行

标签: python python-unittest


【解决方案1】:

如果你尝试过:

$ 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”)。事实上,我认为这是一个错误,如果你想使用这个,你需要安装 unittest2(这是 Python 2.6 的 unittest 的反向移植)。

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

$ python -m unittest

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

OK

【讨论】:

    猜你喜欢
    • 2021-02-21
    • 1970-01-01
    • 2020-11-03
    • 1970-01-01
    • 1970-01-01
    • 2019-10-17
    • 2018-10-20
    • 2021-11-28
    • 1970-01-01
    相关资源
    最近更新 更多