Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
201 views
in Technique[技术] by (71.8m points)

python 的requests问题

导入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:Python27libsite-packages
equests\__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "F:Python27libsite-packages
equestspackagesurllib3contribpyopenssl.py", line 47, in <module>
    from cryptography import x509
  File "F:Python27libsite-packagescryptographyx509\__init__.py", line 7, in <module>
    from cryptography.x509.base import (
  File "F:Python27libsite-packagescryptographyx509ase.py", line 16, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "F:Python27libsite-packagescryptographyx509extensions.py", line 14, in <module>
    from asn1crypto.keys import PublicKeyInfo
  File "F:Python27libsite-packagesasn1cryptokeys.py", line 22, in <module>
    from ._elliptic_curve import (
  File "F:Python27libsite-packagesasn1crypto\_elliptic_curve.py", line 51, in <module>
    from ._int import inverse_mod
  File "F:Python27libsite-packagesasn1crypto\_int.py", line 56, in <module>
    from ._perf._big_num_ctypes import libcrypto
  File "F:Python27libsite-packagesasn1crypto\_perf\_big_num_ctypes.py", line 31, in <module>
    libcrypto_path = find_library('crypto')
  File "F:Python27libctypesutil.py", line 51, in find_library
    fname = os.path.join(directory, name)
  File "F:Python27lib
tpath.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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

ssl 的加密功能包的文件夹路径有特殊字符

换py3吧, 2总有各种各样的编码问题


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...