用pip安装socket
pip install py3socket
然后反应如下:
Collecting py3socket
Downloading py3socket-0.2.1.3-py3-none-any.whl (3.8 kB)
Collecting gevent
Downloading gevent-22.10.2-cp38-cp38-win_amd64.whl (1.5 MB)
-------------------------------------- 1.5/1.5 MB 26.9 kB/s eta 0:00:00
Collecting gevent-websocket
Downloading gevent_websocket-0.10.1-py3-none-any.whl (22 kB)
Collecting Flask
Downloading Flask-2.2.2-py3-none-any.whl (101 kB)
---------------------------------- 101.5/101.5 kB 36.0 kB/s eta 0:00:00
Collecting itsdangerous>=2.0
Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting Werkzeug>=2.2.2
Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)
---------------------------------- 232.7/232.7 kB 23.6 kB/s eta 0:00:00
Collecting Jinja2>=3.0
Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
---------------------------------- 133.1/133.1 kB 27.8 kB/s eta 0:00:00
Collecting click>=8.0
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting importlib-metadata>=3.6.0
Downloading importlib_metadata-6.0.0-py3-none-any.whl (21 kB)
Requirement already satisfied: setuptools in c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages (from gevent->py3socket) (47.1.0)
Collecting greenlet>=2.0.0
Downloading greenlet-2.0.1-cp38-cp38-win_amd64.whl (190 kB)
---------------------------------- 190.7/190.7 kB 24.0 kB/s eta 0:00:00
Collecting zope.interface
Downloading zope.interface-5.5.2-cp38-cp38-win_amd64.whl (211 kB)
---------------------------------- 211.8/211.8 kB 33.7 kB/s eta 0:00:00
Collecting zope.event
Downloading zope.event-4.6-py2.py3-none-any.whl (6.8 kB)
Collecting cffi>=1.12.2
Downloading cffi-1.15.1-cp38-cp38-win_amd64.whl (178 kB)
---------------------------------- 178.8/178.8 kB 27.9 kB/s eta 0:00:00
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
---------------------------------- 118.7/118.7 kB 26.2 kB/s eta 0:00:00
Collecting colorama
Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting zipp>=0.5
Downloading zipp-3.11.0-py3-none-any.whl (6.6 kB)
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.1.2-cp38-cp38-win_amd64.whl (16 kB)
Installing collected packages: zope.interface, zope.event, zipp, pycparser, MarkupSafe, itsdangerous, greenlet, colorama, Werkzeug, Jinja2, importlib-metadata, click, cffi, gevent, Flask, gevent-websocket, py3socket
Attempting uninstall: click
Found existing installation: click 7.1.2
Uninstalling click-7.1.2:
Successfully uninstalled click-7.1.2
然后就开始报错
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
qt5-tools 5.15.2.1.2 requires click~=7.0, but you have click 8.1.3 which is incompatible.
Successfully installed Flask-2.2.2 Jinja2-3.1.2 MarkupSafe-2.1.2 Werkzeug-2.2.2 cffi-1.15.1 click-8.1.3 colorama-0.4.6 gevent-22.10.2 gevent-websocket-0.10.1 greenlet-2.0.1 importlib-metadata-6.0.0 itsdangerous-2.1.2 py3socket-0.2.1.3 pycparser-2.21 zipp-3.11.0 zope.event-4.6 zope.interface-5.5.2
但是输入import socket 可以正常运行
(之前用pip install socket报错过:)
ERROR: Could not find a version that satisfies the requirement socket (from versions: none)
ERROR: No matching distribution found for socket
请帮忙解释一下为什么!