首页 > 代码库 > 安装django 提示ImportError: No module named setuptools
安装django 提示ImportError: No module named setuptools
安装django前要先安装setuptools
先安装一些必要的包,否则会报错:Python build finished, but the necessary bits to build these modules were not found
#yum install -y sqlite bzip2-devel.i686 gdbm-devel.i686 readline-devel.x86_64 readline-devel sqlite-devel openssl-devel.i686 libdbi-devel.i686 ncurses-libs zlib-devel.i686 openssl-devel bzip2-devel gdbm-devel libdbi-devel zlib-devel
还有错误的话下载zlib安装(安装包见附件)
# wget http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz
# tar zxvf zlib-1.2.8.tar.gz
# cd zlib-1.2.8
# ./configure
# make install
# tar zxvf zlib-1.2.8.tar.gz
# cd zlib-1.2.8
# ./configure
# make install
参考:http://www.tuicool.com/articles/FjmA3u
#wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz --no-check-certificate
#tar zxvf setuptools-0.6c11.tar.gz
#cd setuptools-0.6c11
#python setup.py build
#python setup.py install
#cd setuptools-0.6c11
#python setup.py build
#python setup.py install
如果在install时提示Compression requires the (missing) zlib module
回到python解压后的目录中,记得先安装zlib,再启动zlib模块,操作如下
#cd /root/Python-2.7.8
#vi Modules/Setup.dist
搜索zlib,去掉 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz 前面的注释。
#vi Modules/Setup.dist
搜索zlib,去掉 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz 前面的注释。
#cd /root/Python-2.7.8/Modules/zlib
#./configure && make && make install
#./configure && make && make install
然后回到/root/Python-2.7.8目录下
#./configure --enable-shared --prefix=/usr/local/python27
#make
#make install
#make
#make install
ps:安装完上述模块后,django只需要解压,然后执行#python setup.py install 即可
参考:http://farlee.info/archives/centos5-python-mod_wsgi-django-install-osqa.html
附件:
https://app.yinxiang.com/shard/s41/res/d480a890-adba-452c-a3a0-3fa30037c1b3/zlib-1.2.8.tar.gz
安装django 提示ImportError: No module named setuptools
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。