在windows 上安装python的模块有时报错:

C:Usersluohui>pip install zope.interface
Downloading/unpacking zope.interface
Cleaning up...
Exception:
Traceback (most recent call last):
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipbasecommand.py", l
ine 122, in main
status = self.run(options, args)
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipcommandsinstall.p
y", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
e=self.bundle)
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipreq.py", line 1197
, in prepare_files
do_download,
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipreq.py", line 1375
, in unpack_url
self.session,
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipdownload.py", line
572, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipdownload.py", line
433, in _download_url
for chunk in resp_read(4096):
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpipdownload.py", line
421, in resp_read
chunk_size, decode_content=False):
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpip_vendorrequestsp
ackagesurllib3response.py", line 240, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:Python27libsite-packagespip-1.5.6-py2.7.eggpip_vendorrequestsp
ackagesurllib3response.py", line 187, in read
data = self._fp.read(amt)
File "C:Python27libhttplib.py", line 567, in read
s = self.fp.read(amt)
File "C:Python27libsocket.py", line 380, in read
data = self._sock.recv(left)
File "C:Python27libssl.py", line 246, in recv
return self.read(buflen)
File "C:Python27libssl.py", line 165, in read
return self._sslobj.read(len)
SSLError: The read operation timed out

Storing debug log for failure in C:Usersluohuipippip.log

阅读全文

使用php或python连接DB2的配置

最近写的一个程序需要连接一个DB2的数据库上去,配置环境的时候走了不少弯路,看了N多文档,搞了近两天,终于搞好了,在这里记录下:

先说明:系统是centos linux 5.x,64位,系统上的php是5.3,python的版本我有安装python 2.6的。

1)安装IBM Data Server Driver Package (DS Driver)

下载地址:https://www-304.ibm.com/support/docview.wss?uid=swg27016878

我下载下来的包名是:v10.5fp3_linuxx64_dsdriver.tar.gz

tar xvzf v10.5fp3_linuxx64_dsdriver.tar.gz
mkdir /opt/ibm
cp dsdriver /opt/ibm/
cd /opt/ibm/dsdriver./installDSDriver

阅读全文

cenots linux 5.x上默认安装的python版本是2.4.3。现在很多python脚本和模块已经不支持python 2.4的版本了,想用那些模块就需要升级到python 2.6以上。但是centos linux 5.x上的很多软件如yum都是基于python 2.4开发的,把系统自带的python直接升级到python 2.6,会造成yum等这些都不能使用。所以不能这么干,得在一个操作系统上安装两个或多个python版本。

在epel的yum源上,已经有做好的python26包。先加上epel源,再直接 yum安装就行。

yum install python26 python26-devel

直接运行python26命令就是新版本的python,系统上的python命令还是2.4的版本。

阅读全文

发现Mac OS X系统下虽然有net-snmp,但是没有安装net-snmp python的扩展,而这个扩展用pip或easy_install也是安装不了的。只能通过下载源码安装。

下载:

luohui@mac:~/Downloads > wget http://downloads.sourceforge.net/project/net-snmp/net-snmp/5.6.2/net-snmp-5.6.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnet-snmp%2Ffiles%2Fnet-snmp%2F5.6.2%2F&ts=1357547749&use_mirror=nchc
luohui@mac:~/Downloads > tar -xvzf net-snmp-5.6.2.tar.gz
luohui@mac:~/Downloads > cd net-snmp-5.6.2
luohui@mac:~/Downloads/net-snmp-5.6.2 > cd python/
luohui@mac:~/Downloads/net-snmp-5.6.2/python > ls
LICENSE  README   netsnmp  setup.py

阅读全文

作者的图片

阿辉

容器技术及容器集群等分布式系统研究

容器平台负责人

上海