我有一个以
开头的基本python脚本import requests
from bs4 import BeautifulSoup
from datetime import datetime
import difflib
import re
当我通过Hydrogen运行第一个块时( ctrl 输入),我得到一个属性错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-686486c241c8> in <module>()
----> 1 import requests
/home/amanda/.local/lib/python2.7/site-packages/requests/__init__.py in <module>()
51 # Attempt to enable urllib3's SNI support, if possible
52 try:
---> 53 from .packages.urllib3.contrib import pyopenssl
54 pyopenssl.inject_into_urllib3()
55 except ImportError:
/home/amanda/.local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py in <module>()
91 }
92
---> 93 DEFAULT_SSL_CIPHER_LIST = util.ssl_.DEFAULT_CIPHERS
94
95 # OpenSSL will only write 16K at a time
AttributeError: 'module' object has no attribute 'DEFAULT_CIPHERS'AttributeError
'module' object has no attribute 'DEFAULT_CIPHERS'
但是如果我启动一个python控制台,import requests
工作正常。我在这里缺少什么?