文章分类 -  问题汇总

python
git报错:Please make sure you have the correct access rights and the repository exists.问题解决
摘要:一、git报错:Please make sure you have the correct access rights and the repository exists. 原因: 是git服务器没有发现存储本地的ssh密钥。(git服务器已经存在我电脑的ssh秘钥) 解决方案: 总思路:重新生成新 阅读全文

posted @ 2022-01-03 23:29 cherry_ning 阅读(19543) 评论(0) 推荐(1)

Mysql-ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
摘要:一、登录mysql,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决办法 实际是登录MYSQL密码错误,找到正确的登录密码即可。 如果记不起来密码,重置密码参考文章:https:/ 阅读全文

posted @ 2022-01-03 23:19 cherry_ning 阅读(500) 评论(0) 推荐(0)

xshell连不上centos虚拟机
摘要:1、查看本地和虚拟机的ip地址是不是在同一个网段 cmd命令 ipconfig -all 找到本地ipv4地址 虚拟机 虚拟机 ifconfig找到虚拟机的ip地址 如果不在同一个网段,参考该文章设置一下:https://blog.csdn.net/hmq1350167649/article/det 阅读全文

posted @ 2021-11-07 16:51 cherry_ning 阅读(75) 评论(0) 推荐(0)

scrapy_redis 报错:[scrapy.spidermiddlewares.offsite] DEBUG: Filtered offsite request to 'www.youyuan.com': <GET http:/...
摘要:scrapy_redis分布式爬虫遇到的问题,报错[scrapy.spidermiddlewares.offsite] DEBUG: Filtered offsite request to 'www.youyuan.com': <GET http:/... 解决办法: 在settings.py文件加 阅读全文

posted @ 2020-03-23 21:08 cherry_ning 阅读(167) 评论(0) 推荐(0)

scrapy_redis 报错runspider: error: Unable to load 'youyuan.py': attempted relative import with no known parent package
摘要:关于直接运行分布式爬虫文件出现的异常 解决办法如下: import sys,ossys.path.append(os.path.dirname(os.path.dirname(__file__)))from items import YouyuanspiderItem参考文档:https://www 阅读全文

posted @ 2020-03-23 20:18 cherry_ning 阅读(1001) 评论(0) 推荐(0)

虚拟机ping不通本地ip
摘要:本地ip: 虚拟机ping本地ip不通: 解决办法:关闭防火墙 再ping就可以了: 阅读全文

posted @ 2020-03-21 11:21 cherry_ning 阅读(197) 评论(0) 推荐(0)

python 将结果\u6210\u529f这种格式转换成中文
摘要:python 将结果\u6210\u529f这种格式转换成中文 1 import codecs 2 3 def parse_page(self,response): 4 print(' ' + response.url) 5 with codecs.open('deng1.json','wb',en 阅读全文

posted @ 2020-03-15 12:23 cherry_ning 阅读(5643) 评论(0) 推荐(0)

python xpath无法解析网站
摘要:奇怪,xpath无法解析出内容,结果为空。但使用注释的就可以,能解析出来。参考https://bbs.csdn.net/topics/392248325,把headers去掉就好了,不知道为什么。 使用了headers未解析出内容: 1 from urllib import request 2 im 阅读全文

posted @ 2020-02-29 20:17 cherry_ning 阅读(831) 评论(0) 推荐(0)

django报错:VM80:1 Uncaught ReferenceError: cart_del is not defined at <anonymous>:1:1
摘要:一、报错代码及原因 1 {% extends 'df_goods/base.html' %} 2 3 {% block head %} 4 <script type="text/javascript"> 5 $(function(){ 6 total() 7 8 //全选全消 9 $('#check 阅读全文

posted @ 2020-02-14 22:48 cherry_ning 阅读(1054) 评论(0) 推荐(0)

django报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence
摘要:针对django2.2报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence 解决办法: 找到"E:\python_practice_ku\djang 阅读全文

posted @ 2020-02-04 18:05 cherry_ning 阅读(349) 评论(0) 推荐(0)

django报错:AttributeError: type object 'BaseCommand' has no attribute 'option_list'
摘要:执行python manage.py celery worker报错 原因: 应该是django版本的原因 解决办法: 打开"E:\python_practice_ku\django_ttsx\lib\site-packages\djcelery\management\base.py"文件,将60行 阅读全文

posted @ 2020-02-04 15:47 cherry_ning 阅读(640) 评论(0) 推荐(0)

django报错:TypeError: __init__() missing 1 required positional argument: 'on_delete'
摘要:解决办法: 找到"E:\python_practice_ku\django_ttsx\lib\site-packages\djcelery\models.py"文件,在354行后面加上on_delete=models.CASCADE即可 注意:ForeignKey外键属性,必须要加上on_delet 阅读全文

posted @ 2020-02-04 14:33 cherry_ning 阅读(168) 评论(0) 推荐(0)

django报错:from django.utils.encoding import force_text, python_2_unicode_compatible
摘要:报错原因: python版本不兼容 解决方法: 找到”E:\python_practice_ku\django_ttsx\lib\site-packages\haystack\inputs.py"该文件,注释掉第8和11行即可 阅读全文

posted @ 2020-02-03 22:58 cherry_ning 阅读(1635) 评论(0) 推荐(0)

django报错:ImportError: cannot import name 'six' from 'django.utils'
摘要:原因: django版本不兼容,当前django版本太高 解决办法: 重新安装pip install Django==2.2.2即可 阅读全文

posted @ 2020-02-03 22:54 cherry_ning 阅读(2383) 评论(0) 推荐(0)

django已安装过mysqlclient和pymysql,仍报错:django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?
摘要:在settings.py文件设置mysql数据库,启动服务python manage.py runserver 虚拟环境已安装过mysqlclient和pymysql包,仍报错: 解决办法: 在django项目的__init__.py文件下设置: 1 import pymysql 2 pymysql 阅读全文

posted @ 2020-01-27 16:30 cherry_ning 阅读(524) 评论(0) 推荐(0)

django报错:'dict' object has no attribute 'has_key
摘要:Python3以后删除了has_key()方法。解决办法: 修改代码 改为 阅读全文

posted @ 2020-01-23 12:03 cherry_ning 阅读(435) 评论(0) 推荐(0)

django报错:'Specifying a namespace in include() without providing an app_name '
摘要:在根目录下的urls.py中使用了include方法,并且使用了namespace参数,如下图: 在启动项目时,会报错:'Specifying a namespace in include() without providing an app_name ' 这是因为django2相对于django1 阅读全文

posted @ 2020-01-22 22:16 cherry_ning 阅读(242) 评论(0) 推荐(0)

django-在shell命令里面执行,提示type object 'BookInfo' has no attribute 'create'
摘要:如下: 解决办法: 是因为我代码有改动,create方法是后来加的。退出shell重新进下再执行命令就好了 阅读全文

posted @ 2020-01-19 22:35 cherry_ning 阅读(419) 评论(0) 推荐(0)

django迁移文件时,提示:No changes detected
摘要:是因为在项目工程的settings.py对新生成的子应用没有进行注册。 注册后再迁移就好了 阅读全文

posted @ 2020-01-18 11:07 cherry_ning 阅读(247) 评论(0) 推荐(0)

python install mysql-python报错:Building wheel for mysql-python (setup.py) ... error
摘要:解决方法如下: pip install mysqlclient 使用该命令安装 阅读全文

posted @ 2020-01-18 11:04 cherry_ning 阅读(3254) 评论(0) 推荐(0)

导航