Python
※This article is based on Python 3.7.3
TypeError: 'str' object is not callable †[edit]
str( )是python自带函数,是python保留的关键字,定义变量时应该避免使用str作为变量名
如果在使用str( )函数之前已经定义过str变量,则会出现TypeError: ‘str’ object is not callable这个报错
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xd7 in position 0: invalid continuation byte †[edit]
把文件的编码改为 UTF-8
SyntaxError: Non-UTF-8 code starting with '\xc9' in file ./test.py on line 5, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details †[edit]
代码第一行加入:
# -*- coding: UTF-8 -*-
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+ †[edit]
下面两种错误
- ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'
- ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0j 20 Nov 2018'. See: https://github.com/urllib3/urllib3/issues/2168
Terminal窗口执行
pip install urllib3==1.26.15
コメント: