分类: python

Tilo Mitra's avatar

报错django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

报错信息django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).解决方案卸载django: pip3 uninstall django 安装低版本: pip3 install django==1.1.11查看sqlite3版本sqlite3 --version下载:wget http://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz解压:tar zxvf sqlite-autoconf-3280...

Tilo Mitra's avatar

错误SyntaxError: Non-ASCII character '\xe4' in file cmd.py on line 12, but no encoding declared; see h

SyntaxError: Non-ASCII character '\xe4' in file cmd.py on line 12, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details解决python2 会出现以上问题,python3以上版本不会在文件的开头加#-- coding:utf-8 --必须在文件第一行开头写否则加了也会出错以上错

Tilo Mitra's avatar

报错AttributeError: module 'pexpect' has no attribute 'spawn'

报错AttributeError: module 'pexpect' has no attribute 'spawn'原因是Windows下无法运行,并不代表没有spawn解决方案在linux下运行

Tilo Mitra's avatar

邮件发送

import yagmaildef send_email(contents,send_to = 'xx@qq.com'): #send_to 接收人 #登录邮箱,设置登录的账号,密码和port等信息 yag = yagmail.SMTP(user = 'xx@163.com',password = 'xx', host = 'smtp.163.com') #user发送人 #登录完即可一件发送,设置发送给谁,和邮件主题,邮件内容 yag.send(to = send_to, subject = '...

Tilo Mitra's avatar

文件夹和文件操作

#递归删除当前目录下所有文件(不包括目录)# import os# def filedir(Infile):# if os.path.isdir(Infile):# for file in os.listdir(Infile):# path = os.path.join(Infile,file)# filedir(path)# if os.path.exists(Infile):# try:# os.rmdir(Infile)# ...

Tilo Mitra's avatar

链家网站爬取

import requestsimport pandas as pdfrom lxml import etreeimport timefrom multiprocessing.dummy import Poolstart = time.time()title = []house = []place = []rent = []area = []direction = []distinguish = []detail = { "标题": title, "房屋户型": house, "位置": place, "月租金": rent, "面积": area, ...

Tilo Mitra's avatar

SyntaxError: unexpected EOF while parsing错误

SyntaxError: unexpected EOF while parsing错误原因eval(str)的字符串为空就会报错解决读取文件时删除多余的空格

Tilo Mitra's avatar

requests.exceptions.InvalidHeader: Invalid return character or leading space in header: User-Agent错误

requests.exceptions.InvalidHeader: Invalid return character or leading space in header: User-Agent错误原因是分号后面的双引号多了个空格多个空格的headers头headers = { "User-Agent":" Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"}正确headers头headers =...

Tilo Mitra's avatar

pip豆瓣安装源下载库文件

pip install -i https://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com django==1.11.1

下一页  

湘ICP备19016894号 © 2019 小钱