导入requests,提示报错 ''' UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position 1: ordinal not in range(128)'''
问题查了,一般是字符之间转换的。但是到了库这里,就不懂了什么原因。。。。
小生愚钝,请教各位老师,请指点一二,麻烦了。
导入BeautifulSoup,它是正常的。下面是报错的具体信息。
PS :不是本专业的,想学习一点计算机方面的。学个爬虫玩玩。英语比较菜。。。
Traceback (most recent call last):
File "F:/untitled29/lianxi.py", line 5, in <module>
import requests
File "F:\Python27\lib\site-packages\requests\__init__.py", line 52, in <module>
from .packages.urllib3.contrib import pyopenssl
File "F:\Python27\lib\site-packages\requests\packages\urllib3\contrib\pyopenssl.py", line 47, in <module>
from cryptography import x509
File "F:\Python27\lib\site-packages\cryptography\x509\__init__.py", line 7, in <module>
from cryptography.x509.base import (
File "F:\Python27\lib\site-packages\cryptography\x509\base.py", line 16, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "F:\Python27\lib\site-packages\cryptography\x509\extensions.py", line 14, in <module>
from asn1crypto.keys import PublicKeyInfo
File "F:\Python27\lib\site-packages\asn1crypto\keys.py", line 22, in <module>
from ._elliptic_curve import (
File "F:\Python27\lib\site-packages\asn1crypto\_elliptic_curve.py", line 51, in <module>
from ._int import inverse_mod
File "F:\Python27\lib\site-packages\asn1crypto\_int.py", line 56, in <module>
from ._perf._big_num_ctypes import libcrypto
File "F:\Python27\lib\site-packages\asn1crypto\_perf\_big_num_ctypes.py", line 31, in <module>
libcrypto_path = find_library('crypto')
File "F:\Python27\lib\ctypes\util.py", line 51, in find_library
fname = os.path.join(directory, name)
File "F:\Python27\lib\ntpath.py", line 85, in join
result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position 1: ordinal not in range(128)
ssl 的加密功能包的文件夹路径有特殊字符
换py3吧, 2总有各种各样的编码问题