草庐IT

socketobject

全部标签

python - pip install bs4 给出 _socketobject 错误

我正在尝试根据此处的bs文档使用命令pipinstallBeautifulSoup4安装BeautifulSoup4:https://www.crummy.com/software/BeautifulSoup/#Download我正在使用MacOSX10.7.5和python2.7.12当我在终端中运行命令时出现错误:AttributeError:'_socketobject'objecthasnoattribute'set_tlsext_host_name'谁能指出我做错了什么?提前致谢。编辑:根据评论,我尝试运行sudopipinstallpyopenssl但是我得到了相同的“so

Python 属性错误 : type object '_socketobject' has no attribute 'gethostbyname'

我正在尝试在我的程序中这样做:dest=socket.gethostbyname(host)我已经包括了这行:fromsocketimport*在文件的开头。我收到这个错误:AttributeError:typeobject'_socketobject'hasnoattribute'gethostbyname'我运行的是Vista64位。我的操作系统可能有问题吗?我已经关闭了我的防火墙和所有东西。 最佳答案 你应该使用importsocketdest=socket.gethostbyname(host)或使用fromsocketim

python - 属性错误 : '_socketobject' object has no attribute 'set_tlsext_host_name'

在python中,在Ubuntu服务器上,我试图让requests库发出https请求,如下所示:importrequestsrequests.post("https://example.com")首先,我得到了以下信息:/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90:InsecurePlatformWarning:AtrueSSLContextobjectisnotavailable.Thispreventsurllib3fromconfiguringSSLappropr