![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python报错
风华浪浪
这个作者很懒,什么都没留下…
展开
-
django.db.utils.OperationalError: (2013, ‘Lost connection to MySQL server during query‘)
报错如下原因数据库服务器没有开解决办法用终端命令链接服务器试试,如报错误mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQ说明数据库服务器没开,联系dba打开即可...原创 2018-11-13 10:32:44 · 7769 阅读 · 1 评论 -
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un
如果您使用Linux机器,生成新证书并导出指向证书目录的环境变量来修复它。本人mac 环境 安装。Mac机器,生成新证书。原创 2022-11-10 15:47:19 · 717 阅读 · 0 评论 -
ValueError: unsupported format character ‘;‘ (0x3b) at index 625
第一种方式很容易报错,至少我的出现了错误,因为html5中有很多。第二种方式双精度替换来进行填充。原创 2022-11-08 16:32:05 · 948 阅读 · 0 评论 -
python 安装 geopandas及报错解决办法以及示例
GDAL 、Fiona 版本相匹配,本人根据python版本、系统版本,多次尝试不同版本安装。下载的whl版本错误。原创 2022-08-28 01:56:38 · 2021 阅读 · 0 评论 -
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa6 in position 9737: illegal multibyte sequence
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence原创 2022-06-04 21:01:25 · 925 阅读 · 0 评论 -
flask post 请求 ImmutableMultiDict([])
import requestsdef create_users(): data = { "userlist": [ { "username": "zhangsan", "age": 18, }, { "username": "zhangsan", "age": 18, }原创 2022-04-28 21:36:16 · 2645 阅读 · 0 评论 -
ERROR: virtualenvwrapper could not find /root/.local/bin/virtualenv in your path
一、场景pip install virtualenvpip install virtualenvwrapperexport WORKON_HOME=$HOME/.virtualenvsexport VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3export VIRTUALENVWRAPPER_VIRTUALENV=$HOME/.local/bin/virtualenvsource $HOME/.local/bin/virtualenvwrapper.sh原创 2022-01-05 10:10:54 · 595 阅读 · 0 评论 -
UnicodeEncodeError: ‘utf-8‘ codec can‘t encode characters in position 10-11: surrogates not allowed
出现这个问题是里面有非法字符情况一无法保存到数据库, 因为 emojji不是四个字节,所以保存不到,修改utf8编码为utf8mb4CHARSET=utf8mb4;情况二(快他妈难哭了)#熊二来电 狗熊来电原创 2019-07-22 17:14:59 · 6732 阅读 · 3 评论 -
mysqlclient 安装报错
pip3 install mysqlclient原创 2021-12-22 10:21:42 · 592 阅读 · 0 评论 -
nsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is st
一、场景本人利用python的requtsts发送请求,请求的内网链接如 https://192.168.131.128/user,出现如下错误InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.See: https://urllib3.readthedocs.io/en/latest/advanced-usage.ht原创 2021-10-21 13:59:21 · 4782 阅读 · 0 评论 -
MonkeyRunner 常见错误
一、Can't open specified script file Usage: monkeyrunner [options] SCRIPT_FILE解决办法:monkeyrunner C:/xx/xxx/xxx/demo.py执行是绝对路径二、Script terminated due to an exception从上面可以看出是编码错误,解决方法:在代码头部加上 # -- coding: utf-8 -三、urllib3.exceptions.ProtocolError:<'C原创 2020-12-06 21:34:08 · 693 阅读 · 0 评论 -
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“:
一、场景本人安装 pip install bcrypt时报错 Failed building wheel for bcrypt Running setup.py clean for bcryptFailed to build bcryptCould not build wheels for bcrypt which use PEP 517 and cannot be installed directly二、解决办法本人猜测版本原因 版本问题, 于是查看此时安装版本是pip install原创 2020-11-14 20:34:23 · 10711 阅读 · 4 评论 -
Probably the key (‘_kombu.binding.celery_task‘) has been removed from the Redis database.
一、应用场景celery 进行多任务多队列操作时,出现的此错误kombu.exceptions.OperationalError: Cannot route message for exchange 'celery_task': Table empty or key no longer exists.Probably the key ('_kombu.binding.celery_task') has been removed from the Redis database.二、解决办法htt原创 2020-09-15 10:31:04 · 836 阅读 · 0 评论 -
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (ch
转化换时报错tt = "{'start_row': 0, 'end_row': 0, 'env': 0, 'now': 0}"import jsont = json.loads(tt)print(t)把单引号变成双引号即可原创 2019-12-11 20:12:51 · 22746 阅读 · 6 评论 -
query = query.decode(errors=‘replace‘)
django python manage.py makemigrations进行执行时报一下错误 cursor.execute('SELECT @@SQL_AUTO_IS_NULL') File "C:\Users\allve\Envs\my36\lib\site-packages\django\db\backends\utils.py", line 103, in execute sql = self.db.ops.last_executed_query(self.cursor, s原创 2020-08-04 16:22:09 · 2743 阅读 · 3 评论 -
安装mysqlclient报错
pip install mysqlclient报错 building '_mysql' extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release ... _mysql.c _mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such原创 2020-07-23 16:00:24 · 207 阅读 · 0 评论 -
pip install pycrypto
最近在搞微信小程序的订阅接口,发现用到这个模块pycryptofrom Crypto.Cipher import AES 报错于是我这样pip install pycrypto死活装不上,各种报错,想尽了浑身解数。之前我也安装上了,现在不知道天晓得什么原因,装不上了。附赠小dame然后报这个错误error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https原创 2020-07-14 11:54:37 · 4152 阅读 · 0 评论 -
AttributeError: module ‘asyncio‘ has no attribute ‘WindowsSelectorEventLoopPolicy‘
场景爬虫抓包:本人装 pip install mitmproxy 完全ok启动服务mitmdump他就报如下错误File "C:\Users\allve\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main"__main__", mod_spec)File "C:\Users\allve\AppData\Local\Programs\Python\Python36\lib原创 2020-07-12 12:59:34 · 6269 阅读 · 4 评论 -
need more than 3 values to u npack
ValueError(‘need more than 3 values to u npack’,))a, b, c = result()如果传入拆包错误, 返回值的个数,与要拆的包不相同a, b, c = ('ok', 'data', 'msf')原创 2020-07-09 11:38:42 · 450 阅读 · 0 评论 -
Cannot connect to the Docker daemon at tcp://l106.13.**.*:2375. Is the docker daemon running?
/etc/docker/daemon.json会被docker.service的配置文件覆盖,直接添加daemon.json不起作用。可以有如下几种设置:直接编辑配置文件:Centos中docker daemon配置文件在/lib/systemd/system/docker.service,找到以下字段,在后面添加如下,注意,此处不能用"fd://",否则报错... [Service] ...转载 2020-04-22 01:48:25 · 445 阅读 · 0 评论 -
Error: Cannot retrieve repository metadata (repomd.xml) for repository: docker-ce-nightly. Please ve
背景:docker 安装报错Error: Cannot retrieve repository metadata (repomd.xml) for repository: docker-ce-nightly. Please verify its path and try again解决办法进入 /etc/yum.repos.dvim docker-ce.repo enabled...原创 2020-04-21 21:26:04 · 3824 阅读 · 2 评论 -
sqlalchemy.orm.exc.DetachedInstanceError: Instance is not bound to a Session; at
场景:sqlalchemy进行查询时,报以下错误sqlalchemy.orm.exc.DetachedInstanceError:Instance <User at 0x45844f0> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error ...原创 2020-04-16 18:44:09 · 2692 阅读 · 3 评论 -
Cannot find reference 'create_engine' in '__init__.py | __init__.py'
场景最近在总结python ORM时,导入sqlalchemy 会爆红Cannot find reference 'create_engine' in '__init__.py | __init__.py' 在'\uu init_uuu.py | u init_uuu.py'中找不到引用'create_engine'解决办法删除同级目录__init__.py 文件...原创 2020-04-12 12:11:31 · 989 阅读 · 4 评论 -
ValueError: not enough values to unpack (expected 3, got 0)
设置密码celery redis broker 密码celery ,使用 redis 作 broker,当 redis 需要密码访问时,连接的 url 应如下写:redis://:password@127.0.0.1:6379/2xxx 是密码,在密码前需要加一个 : 冒号,否则密码不正确新的报错ValueError: not enough values to unpack (expe...原创 2020-03-29 19:40:46 · 6674 阅读 · 2 评论 -
redis.exceptions.DataError: Invalid input of type: ‘dict‘. Convert to a byte, string or number first
场景使用哈希类型存不进去redistt = dd.hset(user_key, 'user', {"name": "zhangsan", "age": 13, "addr": "上海"})报错如下:解决办法:pip install redis==2.10.6原创 2020-01-06 17:25:53 · 9003 阅读 · 4 评论 -
ModuleNotFoundError: No module named '***'
本人调用时没有__init__.py文件它不是个包,而是文件所以报此错误如果遇到其他问题时,在向上添加吧原创 2020-01-06 14:19:47 · 386 阅读 · 0 评论