报错信息
d:\pythonFile\test>pip install queue
Collecting queue
Could not find a version that satisfies the requirement queue (from versions: )
No matching distribution found for queue
You are using pip version 18.1, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
原因分析
通过pip search queue 确实没发现queue模块。按照报错信息进行网络搜索,发现是因为python2.X 和python3.X 对于queue模块的写法不同。
python2.X必须是Queue, 而在python3.X 中,就修改成queue了。
解决方案
在使用的地方,直接 import queue就行了, 不要安装,Queue是python2.X 自带的库。