
python
文章平均质量分 91
changdejie
这个作者很懒,什么都没留下…
展开
-
python scrapy 安装 lxml 报 ERROR: 'xslt-config' 不是内部或外部命令,也不是可运行的程序的解决办法。
1 解决办法 手动安装 lxml包去http://pypi.python.org/simple/lxml/,下载win7 x64的(注意下载对应你系统版本):https://pypi.python.org/packages/2.7/l/lxml/lxml-2.2.8.win-amd64-py2.7.exe#md5=cfcf7f07a5016a5934271cddde4原创 2014-01-08 12:21:21 · 12969 阅读 · 0 评论 -
mac 安装 tensorflow 提示 Could not find a version that satisfies the requirement
使用下面的命令可以解决。但是要选择合适的平台和版本。所有平台和版本请查看 https://storage.googleapis.com/tensorflow/里面就有。pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-1.2.0-py3-none-any.whl原创 2017-11-16 11:32:32 · 6210 阅读 · 0 评论 -
python ImportError: No module named 的错误解决思路和方法
1 首先要确定 是否 安装了 该模块原创 2014-05-09 12:39:52 · 7340 阅读 · 0 评论 -
scrapy 安装 cryptography>=0.2.1 出现 No package 'libffi' found 的错误
1 安装好的 scrapy 运行出现原创 2014-05-09 10:21:17 · 9237 阅读 · 1 评论 -
ImportError: No module named pkg_resources
升级 python 2.6 到 2.7uojpTraceback (most recent call last): File "/var/www/mydir/virtualenvs/dev/bin/pip", line 5, in module> from pkg_resources import load_entry_pointImportError: No module na原创 2014-04-17 17:30:32 · 9919 阅读 · 0 评论 -
pkg_resources.DistributionNotFound 安装 scrapy错误
1 运行 scrapy出错 报 pkg_resources.DistributionNotFound 错误,表示缺少相应的软件。pkg_resources.DistributionNotFound: w3lib>=1.2原创 2014-04-17 18:32:08 · 12503 阅读 · 0 评论 -
python 报 python 2.7 is required ,which is not found in registry 的错误的解决办法
1 这是由于,在注册表中没有发现该项,而导致的错误,解决办法如下。 新建 register.py 文件2 把下面的内容 粘贴进,该文件# # script to register Python 2.0 or later for use with win32all # and other extensions that require Python regis原创 2014-02-18 12:24:20 · 4916 阅读 · 4 评论 -
python 运行 MySQL-python libmysqlclient.so.18: cannot open shared object file: No such file
1 这是由于 找不到 libmysqlclient.so.18 从而导致的错误 ,解决办法 使用locate 命令 看看 libmysqlclient.so.18存在哪里 locate libmysqlclient.so.182 拷贝 到 ln -s /home/software/mysql-5.5.18/libmysql/libmysqlclien原创 2014-02-18 16:59:48 · 4160 阅读 · 0 评论 -
python mysql_config: command not found 安装 MySQL-python 的错误解决
环境 centos 6.4 64 位系统1 使用 easy_install MySQL-python 报错 ,出现 mysql_config: command not found,查找资料说是找不到 mysql_config 命令而导致的,需要安装 python-devel2 使用 yum install python-devel 安装 python-devel仍然会报这个原创 2014-02-18 16:32:37 · 11895 阅读 · 2 评论 -
windows 7 使用 scrapyd 监控 scrapy的 spider
1 首先需要 安装 scrapyd easy_install scrapyd2 启动 scrapyd:cd c:\Python27\Scripts python scrapyd正常启动,如下图 3 切换 到 工程目录,编辑 scrapy.cfg,把 #url = http://localhost:6800/ 前面的 #号去掉。原创 2014-01-17 15:35:35 · 5398 阅读 · 0 评论 -
windows 和 linux 安装 scrapyd 出现Not a directory site-packages/scrapyd-1.0.1-py2.7.egg/scrapyd/txapp.py
1 这是由于 scrapyd安装的时候没有 解压 相应的 egg而导致的文件找不到的错误。2 解决办法,找到 scrapyd-1.0.1-py2.7.egg 解压缩 里面 有一个 scrapyd的文件,拷贝到 site-packages/scrapyd-1.0.1-py2.7.egg/scrapyd/目录下即可,windows的解决办法和这个一样。原创 2014-01-17 15:48:16 · 2564 阅读 · 1 评论 -
把 scrapy 抓来的内容 相对路径,转换成 绝对路径,用于下一次的抓取
代码如下from scrapy.utils.response import get_base_urlfrom scrapy.utils.url import urljoin_rfcclass TestSpider(BaseSpider): name = 'test' def __init__(self): #转载 2014-01-16 18:48:13 · 6364 阅读 · 0 评论 -
python字符串和变量相加时出现,coercing to unicode need string or buffer nonetype found python 错误的解决
这是由于类型不对,而导致的 1 我是用 “a”+b这个时候产生的错误, 2 这是由于 ,在 python中 +号是针对两个类型相同的变量,而在上的语句中,python不知道 b这个变量的类型二导致的错误(这一点和java很不一样),用下面的语句可以解决 3 ‘a’+str(b)原创 2014-01-23 14:17:43 · 21598 阅读 · 0 评论 -
centos6 上用nginx 和 uwsgi 搭建 python web运行环境
1、 配置基本编译环境yum -y install gcc gdbm-devel readline-devel ncurses-devel zlib-devel sqlite-devel db4-devel tk-devel bluez-libs-devel make bzip2-devel gcc-c++ openssl-devel python-devel2、安装uwsgiw原创 2014-01-22 12:30:34 · 1419 阅读 · 0 评论 -
windows 7 64 位 安装 scrapy ,no win32 module的错误解决。
1 找了好久才找到了对应的版本,下载即可。http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin322 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 这个上面有好多 python的依赖库,很全,不错,赞一个。原创 2014-01-14 15:38:52 · 852 阅读 · 0 评论 -
python 安装 scrapy 源码 ,并 调试 scrapy-tutorial 工程
1 安装上 scrapy 后 在dos上运行 scrapy startproject tutorial,可以创建 一个 tutorial工程,如图。2 打开 debug configs按钮,新建一个 python Run项目,会自动生成如下的debug选项。剩下的就很简单了,debug运行就可以了。原创 2014-01-08 17:43:04 · 976 阅读 · 0 评论 -
python---解决“Unable to find vcvarsall.bat”错误,在windows 64位上安装
今天在安装twisted时老是发生Unable to find vcvarsall.bat的错误。方法如下(手动下载twisted https://pypi.python.org/packages/source/T/Twisted/Twisted-13.2.0.tar.bz2):首先安装MinGW,在MinGW的安装目录下找到bin的文件夹,找到mingw32-make.exe,复制一份更转载 2014-01-08 13:00:33 · 1484 阅读 · 0 评论 -
python 对于任意数据和曲线进行拟合并求出函数表达式的三种方案。
第一种是进行多项式拟合,数学上可以证明,任意函数都可以表示为多项式形式。具体示例如下。###拟合年龄import numpy as npimport matplotlib.pyplot as plt #定义x、y散点坐标x = [10,20,30,40,50,60,70,80]x = np.array(x)print('x is :\n',x)num = [174,236,30...原创 2018-10-16 15:59:06 · 192809 阅读 · 20 评论