virtualenv中或机器中python2.6和2.7版本同时存在时,执行python2.7报错

virtualenv -p /usr/local/bin/python2.7

2env  Running virtualenv with interpreter /usr/local/bin/python2.7
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 17, in <module>
import zlib
ImportError: No module named zlib
解决方法:
yum install zlib zlib-devel openssl  可解决报错问题

下面两个命令作为保留,可不执行,因为安装了也暂时用不上,除非你有用,可自行安装
#yum install -y bzip2-devel    
#yum install gcc openssl-devel bzip2-devel

posted @ 2020-07-01 18:34  天地一体  阅读(263)  评论(0编辑  收藏  举报