自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 Build constraints exclude all the Go files in ```

问题:修改了私域库的情况下再次get私域库遇到该问题Build constraints exclude all the Go files in解决方法:在偏好设置中重新勾选构建索引即可

2021-11-18 23:06:00 7911 3

原创 sqlalchemy,create_engine创建数据库连接报错nodename nor servname provided, or not known

一、错误sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, 'Can\'t connect to MySQL server on \'"rm-bp1jcmm1ly09ef034zm.mysql.rds.aliyuncs.com"\' ([Errno 8] nodename nor servname provided, or not known)')(Background on this error at: htt

2021-10-23 22:55:38 1991

原创 You‘re using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.

错误在Linux环境下通过pytho manage.py collectstatic --settings=settings.local命令收集静态资源的时候报错django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.解决方法如果有多个配置文件,则在指定的settings.

2021-07-18 22:46:40 2315

原创 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclie

问题在开发Django过程中使用python manage.py inspectdb时报错django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclient?解决方法pip install pymysql然后在与项目同名的文件夹下(与settings.py文件在同一目录)的__init__.py文件中写入如下代码import pymysqlpymysql.i

2021-07-18 16:08:45 257

原创 Django中使用Celery报错:‘app‘ object has no attribute ‘user_options‘

运行环境在Win10WSL子系统Ubuntu(20.04.2)下开发Django,使用Celery示例程序:from celery import Celeryapp = Celery('tasks',backend='redis://127.0.0.1',broker='redis://127.0.0.1')@app.taskdef app(x,y): return x + y报错AttributeError: 'app' object has no attribute 'use

2021-07-17 22:47:07 618 1

原创 Win10 WSL Ubuntu如何重新启动(restart),sudo systemctl restart命令无效

问题在Win10的子系统(Ubuntu)中如何重新启动服务,sudo systemctl restart命里无效解决方法打开任务管理器,找到服务选项卡,找到LxssManager右键重新启动即可。

2021-07-16 00:47:53 8174 1

原创 Sentry ./install.sh报错,check-minimum-requirements.sh: line 11: docker-compose: command not found

运行环境Ubuntu 20.04.2在使用./install.sh命令安装Sentry报错▶ Parsing command line ...▶ Setting up error handling ...▶ Checking minimum requirements ...check-minimum-requirements.sh: line 11: docker-compose: command not foundAn error occurred, caught SIGERR on l

2021-07-16 00:07:32 1335

原创 ​ Ubuntu编译安装gettext,以及报错 xgettext: error while loading shared libraries: libgettextsrc-0.21.so处理

​gettext安装(版本0.21)官网地址:https://www.gnu.org/software/gettext/下载文件wget https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz解压tar zxcf gettext-0.21.tar.gz进入gettext-0.21.tar.gzcd gettext-0.21.tar.gz运行配置文件./configure编译make安装sudo make install错

2021-07-14 16:14:10 2919 1

原创 Python sandman2库报错module ‘time‘ has no attribute ‘clock‘ 或 无法将“sandman2”项识别为 cmdlet、函数、脚本文件或可运行程序的名称

在Windows环境下安装sandman2 可能会在pip install sanman2后出现sandman2 : 无法将“sandman2”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次这时候你需要看一下在pip时是否有类似这样的警告WARNING: The script sandman2ctl.exe is installed in 'C:\Users\xxx\AppData\Roaming\Python\Pyt

2021-07-08 09:18:01 405

原创 Python 读取SQL文件语句并执行,从数据库拉取数据

问题:如果SQL脚本文本之间没有换行符,如下这里直接使用 with open命令获得SQL文本,然后使用pandas的read_sql_query函数向数据库直接拉去数据即可。但问题是一般我们写SQL并不会直接在文本文档中写,在Navicat或者Datagrip这样的软件中写SQL我们会用到换行符或者SLQ格式化这些命令,因为在SLQ语句很多的时候,如果不加入换行符就会使得SQL的可读性非常差,这样刚才上面的那句SQL就会变成这样如果在这种情况下使用刚才的方法去读取SQL并向数据库拉

2021-03-31 16:01:38 4535

原创 Python 报错 positional argument follows keyword argument

报错:读取文件的时候报错positional argument follows keyword argument错误原因是因为参数位置不正确python中的函数在读取参数的时候是按照位置参数再到可变参数来读取,位置参数有更高的优先级。...

2021-03-31 15:27:29 16677

原创 Python 报错 ‘gbk‘ codec can‘t decode byte 0xae in position 26: illegal multibyte sequence

报错:在用python读取本期的SQL文件时报错:'gbk' codec can't decode byte 0xae in position 26: illegal multibyte sequence运行代码如下从错误信息中可以看出是因为SQL文件的编码为gbk,这里我们需要将读取文件改为Python可识别的编码...

2021-03-31 15:19:27 1477

原创 Python 报错 unsupported format character

报错:在jupyter中写完操作MySQL数据库的相关程序后将代码移入pycharm中运行时报了如下错误:原因:因为pychon执行sql语句时对SQL语句中的时间格式化函数中的%Y与python的%s参数存在冲突,在jupyter中运行不会出现问题。中存在类似DATE_FORMAT(CREATE_TIME, ‘%Y-%m-%d’) 的写法,其中%Y与python的参数%s冲突解决方法:将时间格式化参数改为%%Y-%%m-%%d即可...

2021-03-25 16:50:44 2015

原创 Python jupyter notebook插件 Nbextensions安装及其使用

1. 安装Nbextensions插件,若是遇到下载问题,参考pip换源教程pip install jupyter_contrib_nbextensions2. 配置Nbextensionsjupyter contrib nbextension install --user3. 重启jupyter notebook点击Nbextensions进行配置,配置前将红框内的选项去除。,这个选项的意思是为了保护你的开发环境禁用了Nbextensions配置,防止不兼容的情况出现。4.

2021-03-15 11:27:05 7457 2

原创 Python pip换国内源问题(Windows)

pip国内源清华大学https://pypi.tuna.tsinghua.edu.cn/simple/中国科技大学https://pypi.mirrors.ustc.edu.cn/simple/中国科学技术大学http://pypi.mirrors.ustc.edu.cn/simple/豆瓣(douban)http://pypi.douban.com/simple/阿里云http://mirrors.aliyun.com/pypi/simple/以清华源为例,清华源每五分...

2021-03-15 10:22:54 1006

原创 Python jupyter notebook 修改默认文件夹路径

环境:win10+Anaconda3(64-bit)修改步骤1. 打开jupyter notebook快捷方式2.右键快捷方式,属性,删除"%USERPROFILE%/"字段3. 修改jupyter notebook配置文件,命令提示符(管理员)键入以下命令# 创建jupyter notebook配置文件jupyter notebook --generate-config# 按照命令符提示地址C:\Users\"用户名"\.jupyter下找到配置文件 jupyter_n.

2021-03-15 09:42:52 478

原创 Python Pandas库不支持Excel文件读取,报错Excel xlsx file; not supported

异常:Excel xlsx file; not supported原因:xlrd更新至2.0.1版本后只支持xls文件,所以使用pandas.read_excel(‘file_name.xlsx’)会出现报错。解决方法:1. 使用pandas.read_excel(‘file_name.xlsx’,engine=‘openpyxl’)2. 安装旧版xlrd:- pip...

2021-02-20 21:04:57 7025 3

原创 Python Celery库不支持windows,报错 No module named ‘xxx’

pip install eventlet在文件中加入os.environ.setdefault(‘FORKED_BY_MULTIPROCESSING’,‘1’)执行 celery -A server worker -l info -P eventlet出错原因是celery更新后不支持Windows

2021-01-19 17:04:18 769 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除