【错误汇总】PYTHON开发
MySQL相关
1、1153, “Got a packet bigger than ‘max_allowed_packet’ bytes”
set global max_allowed_packet=524288000;
2、(1292, “Truncated incorrect DOUBLE value: ‘2020-02’”)
python通过MySQLdb执行sql语句时,如果查询条件内有时间类型的例如:currentdate={obj.currentdate}需要改成currentdate='{obj.currentdate}' # 在花括号外侧增加单引号
Python相关
1、 error in anyjson setup command: use_2to3 is invalid.
pip install setuptools==57.5.0
2、 ImportError: cannot import name ‘render_to_response’
修改报错文件的引入:*\site-packages\djcelery\admin.pyfrom django.shortcuts import render_to_response替换为from django.shortcuts import render
3、 ModuleNotFoundError: No module named ‘django.core.management.validation’
pip install setuptools==57.5.0
4、 关于OSError: [WinError 123] 文件名、目录名或卷标语法不正确。: ‘<frozen importlib._bootstrap>‘解决方法
查看settings内的apps里是否有不存在或者已删除或存在报错的内容
5、django.core.exceptions.ImproperlyConfigured: The included URLconf ‘<module ‘apps.expense_cdn’ from ‘E:\expense_system\apps\expense_cdn\init.py’>’ does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.
views.py文件中没有patterns进行匹配,导致找不到路径 查看项目下的urls.py文件中路径指向,include()路径是指向了视图函数文件,导致无法匹配有些错误是因为创建的应用中缺少urlpatterns也会报同样的错误。将之前指向views文件的指向urls即解决了问题
6、python manage.py makemigrations,执行不生成迁移文件
1、查看settings INSTALLED_APPS是否添加,或者添加至 ***.apps.***Config2、如果是多个app,并且单独app内新建了models文件夹,在models文件夹内__init__内from .你的models文件名称 import *3、基本即可解决
7、django在上传文件过程中的报错
报错如下:[uwsgi-body-read] Timeout reading 45256 bytes. Content-Length: 2043522 consulOSError: timeout during read(65536) on wsgi.inputdjango.http.request.UnreadablePostError: timeout during read(65536) on wsgi.input解决方式:1、首先查看nginx的缓冲区的设置2、查看uwsgi的最大允许上传文件的大小设置3、如果都设置正确,name优先选择重启nginx,一般可以解决,不行在重启项目以上是我遇到时候的解决办法
Centos 7.9相关
1、可视化界面分辨率
命令行输入: xrandr![执行结果](https://img-blog.csdnimg.cn/bf7f7cac2014465b8231199fd9a61860.png#pic_center)命令行输入: xrandr -s 0 此处0为上述分辨率的第一个,以此类推即可
2、网络设备启用
网络提示 未启用 NetworkManager 先执行 chkconfig NetworkManager on![执行结果](https://img-blog.csdnimg.cn/09a5ffe688f84a11b9eddb491e55135f.png)再执行 service NetworkManager start![执行结果](https://img-blog.csdnimg.cn/92e4b3139404451a8c662cf777228296.png)
Oracle相关
1、python和Oracle,中文问号的问题
import os os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
Vue相关
1、 options has an unknown property ‘hotOnly’. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?,…
hotOnly: false 改为 hot: "only"
2、vue 报错
Error: Rule can only have one resource source (provided resource and test + include + exclude) in"exclude": [null],"use": [{"loader": "/Users/juanpablo/front-treatments/node_modules/cache-loader/dist/cjs.js","options": {"cacheDirectory": "/Users/juanpablo/front-treatments/node_modules/.cache/babel-loader","cacheIdentifier": "81fef5a6"},"ident": "clonedRuleSet-38[0].rules[0].use[0]"},{"loader": "/Users/juanpablo/front-treatments/node_modules/babel-loader/lib/index.js","options": "undefined","ident": "undefined"}]
} 解决方法删除webpack,重新装以前的版本。npm uninstall webpacknpm install webpack@^4.0.0 --save-dev
3、VUE警告错误:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “placement”
vue3中使用的ELEMENT UI版本可能存在冲突,我的是使用 <el-date-picker这个时间控件,造成的这个警告,但是步影响程序,本着去红的态度,查找了解决办法,找到了解决方法。首先,降低ELEMENT UI版本,我的是 "element-ui": "^2.15.6",降低到 "element-ui": "2.15.0",然后没完,,我在卸载的过程中遇到了问题,无法卸载,我果断直接安装指定版本,然后,就没有然后了果断删除node包,在package.json内改好版本号,重新安装,如果不想遇到 上面第二个错误,就果断将webpack的版本页改到4.0.0,可以节省时间,提高想效率。
4、VUE请求后,收到404、403等错误的结果,通过Axios请求后,无法获取res,不能进行跳转。示例代码如下
自己封装的一个axios请求request("xxxxxxxx", "get", json).then((res) => {if (res.code === "0"){xxxxxxxxxxxxxxx}})由于接口请求错误是403,代码逻辑始终进入不到if判断里,then方法也没有进入,代码不能执行,后来发现需要在then的同级,添加catch来进行错误监听,才能捕捉接口错误并进行逻辑判断。request("xxxxxxxx", "get", json).then((res) => {if (res.code === "0"){xxxxxxxxxxxxxxx}})catch (error) {xxxxxxxxx -----在这里进行逻辑处理,例如403的话,可以进行页面跳转等等}由于个人对vue不熟悉,这个错误困扰了半天时间,记录下来。改天系统学习下,再来修改!
5、ELEMENT UI上传组件不执行 on-success钩子的问题
<el-uploadclass="upload-demo"dragaction="https://jsonplaceholder.typicode.com/posts/"~~:file-list="fileList"~~ :on-remove="handleRemove" :on-change="onchange" :on-success="onSuccess" multiple><i class="el-icon-upload"></i><div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div><div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div></el-upload>如果你的上传需要调用on-success,但是写入了并不生生效,请删除代码里的 :file-list="fileList"具体原因没深入查找,先解决项目问题,后续研究
【错误汇总】PYTHON开发相关推荐
- python ckeditor上传图片400错误_又一款python开发神器
优秀的python开发工具有很多,比如pycharm,spder,ipython,jupyter以及很多编辑器的插件等.但是如果利用python来做数据分析的话,要是有一款类似Rstudio的工具就好 ...
- Python开发最常犯错误总结10种
不管是在学习还是工作过程中,人都会犯错.虽然Python的语法简单.灵活,但也一样存在一些不小的坑,一不小心,初学者和资深Python程序员都有可能会栽跟头.本文是Toptal网站的程序员梳理的10大 ...
- 面向Python开发人员的综合置信区间全面理解
面向Python开发人员的综合置信区间全面理解 置信区间是以范围表示并汇总统计中的不确定性的.换句话说,这是一系列我们确信自己真正价值所在的价值观.例如:我有95%的信心认为人口平均数在8.76到15 ...
- python开发中级_针对中级Python开发人员的13个项目构想
python开发中级 Learning the basics of Python is a wonderful experience. But the euphoria of just learnin ...
- 利用Python开发App
我很早之前就想开发一款app玩玩,无奈对java不够熟悉,之前也没有开发app的经验,因此一直耽搁了.最近想到尝试用python开发一款app,google搜索了一番后,发现确实有路可寻,目前也有了一 ...
- python 创意项目_针对python开发人员的10个很棒的python项目创意
python 创意项目 The joy of coding Python should be in seeing short, concise, readable classes that expre ...
- python开发环境有中文的吗_中文 python
Python sublime 中文的问题汇总[收藏] Python sublime 中文编译和中文路径问题 转载请标明出处: https://blog.csdn.net/DJY1992/article ...
- python开发图片工具_工具|ImagePy:一款基于Python的高扩展性开源图像处理框架
加入极市专业CV交流群,与6000+来自腾讯,华为,百度,北大,清华,中科院等名企名校视觉开发者互动交流!更有机会与李开复老师等大牛群内互动! 同时提供每月大咖直播分享.真实项目需求对接.干货资讯汇总 ...
- 从零开始,教你如何安装、配置Python开发环境,Python入门安装教程,超级详细
近日,我鼓起勇气从头开始正儿八经地配置一个更轻量.更趁手的 Python 开发环境.经过一番折腾,我比较顺利地在 Windows 10 上配置了一个比较满意的 Python 环境: 安装稳定版本的 P ...
- 太强了,Python 开发桌面小工具,让代码替我们干重复的工作~
作者 | Cherish 来源 | 杰哥的IT之旅 决定写这篇文章的初衷是来源于一位小伙伴的问题,关于"如何根据数据源用 Python 自动生成透视表",这个问题背后有个非常好的解 ...
最新文章
- Android Interactive Animation
- speedtorch 加速神经网络
- TYVJ 2002 扑克牌 题解
- malloc的内存分配原理
- JdbcTemplate和NamedParameterJdbcTemplate
- python对平面设计帮助_平面设计工作心得
- 微课|玩转Python轻松过二级(2.2.2节):关系运算符
- Thumbnailator java图片压缩,加水印,批量生成缩略图
- protobuf java linux_linux下安装protobuf及其使用
- perl判断变量是数值_Perl学习12之defined undef使用
- 国内外自动驾驶仿真软件总结
- matlab图像拼接 设计,MATLAB图像拼接算法及实现.doc
- Facebook团队提供人工智能视频教程:机器学习入门教程指南
- WEB 系统架构演变
- 无法访问。您可能没有权限使用网络资源。请与这台服务器的管理员联系查明你是否有访问权限。
- 创建线程-学到了4种方法
- 约翰霍普金斯大学计算机博士收入,约翰霍普金斯大学计算机科学研究生项目详情!...
- 企业内部控制管理与全面风险管理体系建设知识问答
- 《灰故事》:他用曲笔描绘着我们
- js数组操作的一些方法在面试题的使用