Python程序遇到的问题解决
问题一:升级 pip 出现问题
You should consider upgrading via the 'D:\installed\python\python_exe\python.exe -m pip install --upgrade pip' command
原文:https://blog.csdn.net/qq_43791377/article/details/102811113
问题二:pip install seaborn 出错
学习seaborn参考:https://www.jianshu.com/p/c26bc5ccf604
尝试从出错的关键词(retry,timeout--网络超时)中,寻找解决问题的办法
https://blog.csdn.net/hanzhenqwe/article/details/54573376
https://blog.csdn.net/weixin_43690010/article/details/115241684
1.因为 pip 安装 seaborn 的时候,不会安装 seaborn 依赖的库
(seaborn 依赖 matplotlib、numpy、 scripy、pandas)
注意:安装 scripy 时,
* 先下载python版本对应的 scripy 的 whl 文件(下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy),
* 放到python安装目录下的 Scripts 目录下,
* 执行命令:D:\installed\python\python_exe\Scripts>python.exe -m pip install SciPy-1.8.1-cp38-cp38-win_amd64.whl
* 安装成功
2.因为网速的问题(seaborn的官网下载路径在国外,对网络的质量要求很高),加入国内的源即可
国内 pip 源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ (安装 seaborn 成功)
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
源 选择带有安全认证的:https
或者 尝试相信 http 也可以
pip install seaborn -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
pip 安装 seaborn 的命令:
D:\installed\python\python_exe>pip install seaborn -i https://pypi.tuna.tsinghua.edu.cn/simple/
问题三: python 扩展库 whl文件 存放在哪里
pip安装Python扩展库时下载的文件(如whl文件)存放于哪里的
https://blog.csdn.net/wenhao_ir/article/details/125271929
问题四:读取超时-->网络超时
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/seaborn/
https://blog.csdn.net/bjtu_linxinyu/article/details/105468658
问题五:
问题: pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as,zuozhe,time,keywords) values (('\nBetween-Class Learning for Image Classifica' at line 1") 解决:字符转义问题 https://blog.csdn.net/qq_43312279/article/details/118797631
问题六:
pymysql.err.OperationalError: (1364, “Field ‘groups‘ doesn‘t have a default value“) 解决:勾选了“不是null” 将数据库表中定义字段默认值”不是null”去掉,修改为NULL
问题七:
pymysql.err.DataError: (1406, "Data too long for column 'as' at row 1") 解决:python爬虫获取的数据过长 在mysql的命令行界面执行 SET @@global.sql_mode=''; 进入mysql:1.找到安装mysql的目录,从命令行界面进去 2.输入命令 mysql -u root -p 之后输入mysql密码

浙公网安备 33010602011771号