
error
彭世瑜
记录我的工作学习笔记
展开
-
使用lsof解决flask的端口占用问题
运行flask程序时, 提示端口被占用报错socket.error: [Errno 48] Address already in use解决查看占用5000端口的进程lsof -i:500关闭进程kill <pid> 参考 解决flask的端口占用...原创 2018-05-18 09:27:26 · 2503 阅读 · 0 评论 -
ImportError: No module named Crypto.Cipher
阅读公司的接口代码,发现有如下代码from Crypto.Cipher import AES报错: ImportError: No module named Crypto.Cipher解决方法: pip install pycrypto如果还是报错, 找到安装目录是 c:/python27/Lib/site-packages/crypto 把crypto改成大写Cr...原创 2018-09-08 17:06:19 · 25126 阅读 · 0 评论 -
error: ImportError: No module named cv2
代码:import cv2报错ImportError: No module named cv2解决:pip install opencv-python 参考 Ubuntu系统下Import cv2提示no modules …错误原创 2018-08-20 16:20:26 · 1186 阅读 · 0 评论 -
error: scrapy TypeError: 'float' object is not iterable
正常运行爬虫,在公司电脑上没问题,回到家自己电脑上就出现了下面的报错,百思不得解Traceback (most recent call last): File "D:\.virtualenvs\spider\lib\site-packages\twisted\internet\defer.py", line 1384, in _inlineCallbacks result = re...原创 2018-08-26 11:27:25 · 3343 阅读 · 0 评论 -
error:selenium操作Firefox报错socket.error: [Errno 10054]
selenium操作Firefox报错socket.error: [Errno 10054]开始以为是时间不够,增加等待时间,然后没有什么用查看:https://github.com/mozilla/geckodriver/releases发现版本要求,再查看本地的Selenium 版本太低,是3.6的,果断升级Firefox 57 (and greater)Selenium 3...原创 2018-08-18 11:25:10 · 1510 阅读 · 0 评论 -
python编程:json indent can't multiply sequence by non-int of type 'str'
代码:print(json.dumps({"key": "value"}, indent="\t"))问题:json indent can't multiply sequence by non-int of type 'str'借助百度翻译:JSON缩进不能用“STR”类型的非int乘以序列参看json的dumps实现也没指明类型,隐约看到integer,修改代码如下...原创 2018-07-04 11:50:25 · 2536 阅读 · 0 评论 -
OperationalError: (1366, "Incorrect string value)
python2爬虫抓取数据的时候,保存到数据库报错:OperationalError: (1366, "Incorrect string value)发现字符中存在表情符号 使用re正则库将表情符号过滤掉即可, 去除字符串中emoji符号# 过滤表情符号 def filter(self, text): try: text = unic...原创 2018-07-09 14:41:18 · 1555 阅读 · 0 评论 -
Python编程:pypi打包报错[SSL: CERTIFICATE_VERIFY_FAILED]
参照我原来的文章打包上传pypi包时报错: Python编程:为世界贡献你的轮子-pipy打包error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>看到网上说此方法已经不支持需要用 twine 模块打包 参考: Packagi...原创 2018-06-19 15:54:48 · 1386 阅读 · 0 评论 -
sqlalchemy报错Please use '@@transaction_isolation' instead")
使用sqlalchemy报错1287, "'@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead") result = self._query(query)查看我已安装的版本pip install s...原创 2018-06-19 13:48:58 · 2077 阅读 · 0 评论 -
fabric.api No module named api
导入报错from fabric.api import *ImportError: No module named 'fabric.api'解决经过网上查阅,发现是版本的问题 截图出处:http://docs.fabfile.org/en/latest/upgrading.html卸载原有模块,重新指定版本安装,下面这个可以pip install fabric...原创 2018-06-14 14:34:05 · 9465 阅读 · 1 评论 -
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)
报错SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)解决pip install -U requests[security]说明: 后面的方括号,pip会安装三个security相关的package:pyopenssl cryptogra...原创 2018-06-11 16:17:41 · 7364 阅读 · 0 评论 -
AttributeError: 'module' object has no attribute 'X509_up_ref'
主要报错:AttributeError: 'module' object has no attribute 'X509_up_ref'解决办法卸载再重装pip uninstall pyOpenSSLpip install pyOpenSSL 参考: AttributeError: ‘X509’ object has no attribute ‘_x509’问题解...原创 2018-05-08 17:08:23 · 7398 阅读 · 2 评论 -
Command "python setup.py egg_info" failed with error code 1
安装第三方包的时候报错Command "python setup.py egg_info" failed with error code 1 解决更新pippip install --upgrade pip再安装需要安装的第三方扩展包 参考: Command “python setup.py egg_info” failed with error code 1…...原创 2018-05-21 14:19:34 · 10103 阅读 · 1 评论 -
RuntimeError: Python is not installed as a framework
问题描述引入 matplotlib 的时候import matplotlib.pyplot as plt报错如下:Traceback (most recent call last):File "<stdin>", line 1, in <module>...in <module>from matplotlib.backends imp...原创 2018-05-06 23:04:43 · 1621 阅读 · 0 评论 -
ImportError: from . import _imaging as core
报错现象from PIL import Imageimport numpy as npimg = Image.open("images/bigsea.jpg")print(img)部分报错信息:Traceback (most recent call last): from PIL import Image from . import _imaging a...原创 2018-05-06 20:15:38 · 13773 阅读 · 0 评论 -
fatal: The remote end hung up unexpectedly
问题描述使用git push推送代码的时候报错:fatal: The remote end hung up unexpectedly解决办法.git目录下面,修改config文件,增加 postBuffer [branch "master"] remote = origin merge = refs/heads/master[http] p...原创 2018-05-12 00:13:12 · 1125 阅读 · 0 评论 -
modified: (modified content, untracked content)
git status 报错提示 modified: python_psy_pc (modified content, untracked content)大概意思是xxx目录没有被跟踪。那自然push上去的时候是空的了解决办法1、目录下有一个.git 目录,删除.git目录 2、重新git add .就可 参考 modified: xxx(modi...原创 2018-05-11 23:18:55 · 12154 阅读 · 0 评论 -
css文件能加载但是没有生效
使用nginx+django部署项目的时候,为了提高加载速度,我将css,js,image等静态资源在nginx中配置了路径本地测试没有问题,代码提交线上就出问题了,出现了这么个情况:css文件能加载但是没有生效经过查找资料,大概从以下两个方面入手检查:1、考虑css文件引用是否正确2、考虑服务器nginx配置静态文件是否正确打开浏览器console,出现这么一句话Resource...原创 2018-09-18 16:33:43 · 8771 阅读 · 4 评论