![](https://img-blog.csdnimg.cn/20210813194529836.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
各种bug及安装教程
记录各种bug,一些插件及软件的安装教程。------作者:sun
Dream丶Killer
学如逆水行舟,不进则退;心似平原走马,易放难收。
展开
-
(成功解决)Python连接clickhouse
第一次尝试用Python连接clickhouse数据库,踩了不少坑,特此记录,帮助后人少犯错!运行环境:python 3.8.3clickhouse_driver==0.2.3clickhouse_sqlalchemy==0.2.0sqlalchemy==1.4.32clickhouse_driver连接的两种方式1.Client借鉴网上的方法from clickhouse_driver import Clientclient = Client(host=host, port=8原创 2022-03-22 13:19:07 · 18350 阅读 · 6 评论 -
pymysql连接数据库报错:TypeError: __init__() takes 1 positional argument but 5 were given
问题描述import pymysqldb = pymysql.connect("127.0.0.1", "root", "password", "test")上述代码在 jupyter notebook 上不能运行,但是在 Pycharm 中可以运行。报错原因两个 pymysql 版本不一样,0.9.2 上可以运行,最新版 1.0.2 上面不能,最新版需要指定参数名,不能够省略。解决方法将省略的参数添加即可。import pymysqldb = pymysql.connect(.原创 2021-07-29 16:50:27 · 2198 阅读 · 0 评论 -
解决Pycharm中导入docx模块中Document函数报错问题
解决Pycharm中导入docx模块中Document函数报错问题通过pycharm安装的docx模块,在导入Document函数后,运行报错No mudule named ‘exceptions’,原因是docx.py代码中,有使用exceptions模块,自己又没安装。但通过pycharm安装exceptions模块总是失败,所以上网查了下,总结下方法。1.如果用pycharm安装了docx模块,先将其uninstall,然后,在网站上下载python_docx‑0.8.10‑py2.py3‑non原创 2020-10-25 13:34:05 · 8648 阅读 · 9 评论 -
修改命令提示符中的默认python版本
问题描述我在 Pycharm 中使用的 Python 版本与 cmd 中默认的版本不同,导致在 cmd 中执行 .py 文件时,有些模块会显示没有安装,而该文件在 Pycharm 中又可以运行。解决方法cmd 中的 Python 默认使用的是环境变量 Path 中排在最上面的那个路径,那么我们只需要将要使用的 Python 版本路径换到最前面即可。...原创 2021-06-19 16:12:48 · 2770 阅读 · 4 评论 -
ImportError: cannot import name ‘Imputer‘ from ‘sklearn.preprocessing‘
出错代码from sklearn.preprocessing import Imputer错误:ImportError: cannot import name 'Imputer' from 'sklearn.preprocessing' 原因:该类已弃用解决方法from sklearn.impute import SimpleImputerimputer = SimpleImputer(missing_values=np.nan, strategy='mean')...原创 2021-04-12 14:59:28 · 948 阅读 · 1 评论 -
超有效的解決方案:Failed to load resource: the server responded with a status of 404 (Not Found)
Failed to load resource: the server responded with a status of 404 (Not Found)问题描述:在nextjs项目里想要引入图片,地址都是对的,但是最后报404错误解决办法:1、在项目根目录添加一个static文件夹,在static中创建一个images文件夹,将图片放在images文件夹中。2、引入方式<img src="/static/images/bg.jpg" alt="bgImage" />3、安原创 2021-05-03 20:07:18 · 8565 阅读 · 2 评论 -
Access to XMLHttpRequest at *** from origin ‘***‘ has been blocked by CORS policy: Response to...
Access to XMLHttpRequest at *** from origin ‘null’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource当你看到这个错误信息的时候,恭喜你,你遇到了前端攻城狮.原创 2021-04-30 11:10:00 · 1866 阅读 · 0 评论 -
UserWarning: [W008] Evaluating Doc.similarity based on empty vectors.
使用spacy计算两个token的相似性时,出现标题的警告。similar_word.similarity(token)UserWarning: [W008] Evaluating Doc.similarity based on empty vectors.报错原因:当similar_word不是一个有效的spacy doc时,则会出现如下报错。栗子:import spacynlp = spacy.load('en_core_web_md')tokens = nlp(u'apple b原创 2021-04-15 15:23:01 · 616 阅读 · 1 评论 -
OSError: [E053] Could not read config.cfg from C:\Users\pc\AppData\Local\Programs\Python\Python38\Li
在执行spacy.load('en_core_web_md')代码时报错。OSError: [E053] Could not read config.cfg from C:\Users\pc\AppData\Local\Programs\Python\Python38\Lib\site-packages\en_core_web_md\en_core_web_md-2.2.5\config.cfg。经网上查找发现出现这个问题的原因是:下载的en_core_web_md与spacy的版本不兼容,我使用的en原创 2021-02-24 19:02:43 · 9272 阅读 · 20 评论 -
解决Seaborn.load_dataset() 运行报错
解决Seaborn.load_dataset() 报错使用load_dataset方法加载数据集时,报如下错误:import matplotlib.pyplot as pltimport seaborn as snssns.set()tips = sns.load_dataset('tips')sns.relplot(x='total_bill', y='tip', col='time', hue='smoker', style='smoker', size='size', data=t原创 2021-01-14 20:17:02 · 3202 阅读 · 0 评论 -
xlrd.biffh.XLRDError: Excel xlsx file; not supported
安装了xlrd库之后,使用pandas读取.xlsx文件报错如下:经查询发现时新版本的xlrd只支持.xls文件,只需要将其退回指定旧版本即可。# 先卸载当前版本的xlrdpip uninstall xlrd# 安装旧版本pip install -i https://pypi.douban.com/simple xlrd==1.2.0之后运行就无错误。...原创 2021-03-19 17:51:02 · 224 阅读 · 0 评论