猫史档案馆


有谁会socket吗

用户:PlumStevenPlumSteven查看:2 回复:5 评论:2 创建时间:2022-02-22T14:21:49


为什么有时候我单单import socket就能弄出TypeError:module is not callable

然后我改成from socket import *,s = socket()这一句又报错:NameError:socket is not defined


回复

上一页1 页 / 共 1下一页
Vincent_xiaoboVincent_xiaobo

每安装这个库

打开控制台,输入

py -m pip install socket

点赞0


评论


伴雪纷飞伴雪纷飞

估计是下载错了,你重新下载一遍

点赞0


评论


PlumStevenPlumSteven

会出现这个:
ERROR: Could not find a version that satisfies the requirement socket (from versions: none)
ERROR: No matching distribution found for socket
WARNING: You are using pip version 21.1.1; however, version 22.0.3 is available.
You should consider upgrading via the 'C:\Users\李懿轩\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.

点赞0


评论


PlumStevenPlumSteven

然后socket不是自带的吗

点赞0


评论


lsk666666lsk666666

import socket

soc = socket.socket()

点赞1


评论