unittest installation error Could not find a version that satisfies the requirement

雨燕双飞 提交于 2019-12-05 15:06:50

问题


Could someone please help me with this error message:

Could not find a version that satisfies the requirement unittest

I installed the latest Python and PyCharm and try to install the package unittest but get the above error. So far my experience with Python is a bit like dll hell ...


回答1:


If you tried this:

$ pip install unittest
Collecting unittest

  Could not find a version that satisfies the requirement unittest (from versions: )
No matching distribution found for unittest

It's normal to have an error because unittest is not a valid package on Pypi. The only distribuable is unittest2-0.0.0.tar.gz but the name is not correct, it should be unittest-0.0.0.tar.gz (without "2"). In fact I think it's an error and if you want to use this one you need to install unittest2 (which is a backport of unittest for Python 2.6).

But unittest is a standard module, which you don't need to install:

$ python -m unittest

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

OK


来源:https://stackoverflow.com/questions/46133254/unittest-installation-error-could-not-find-a-version-that-satisfies-the-requirem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!