Windows下Python环境搭建(包括Win7 64位下安装setuptools)
2013-08-19 13:58
585 查看
Linux系统参考:Linux下Python环境搭建
http://f.dataguru.cn/forum.php?mod=viewthread&tid=36405&fromuid=4771
系统环境
电脑型号 联想 ThinkPadT410 笔记本电脑
操作系统 Windows 7 旗舰版 64位 SP1 (DirectX 11 )
处理器 英特尔 Core i5 M560 @ 2.67GHz 双核笔记本处理器
主板 联想 2522NT7 (英特尔 QM57 芯片组)
内存 6 GB ( 尔必达 DDR31067MHz / 尔必达 DDR3 1333MHz )
1.下载
Python:
地址:http://www.python.org/getit/
版本:python-2.7.3.amd64.msi
setuptools:http://pypi.python.org/pypi/setuptools#windows
ez_setup.py文件:http://peak.telecommunity.com/dist/ez_setup.py
numpy:
地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/
版本:numpy-unoptimized-1.6.2.win-amd64-py2.7.exe
2.安装Python
![](http://f.dataguru.cn/farattach/forum/201212/05/2343328d7mmznvkdkzgt63.jpg)
选择安装路径:
![](http://f.dataguru.cn/farattach/forum/201212/05/234333a3aoxqp4aywae7w6.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234333q0i2zqq033rn0zq9.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234334abx7tutff7x22fse.jpg)
除了选择安装路径外,其他的基本都可以默认了,一直到安装完成。此时的目录结构如下:
![](http://f.dataguru.cn/farattach/forum/201212/05/234334irxoyun1j99zu9nn.jpg)
3为Python配置环境变量
![](http://f.dataguru.cn/farattach/forum/201212/05/234334bppmbeji8sb2gvj3.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234335f09p7r7901pg175k.jpg)
测试,Python安装成功。
4.安装setuptools
官网声称.exe版本的不支持64位Windows系统,推荐使用ez_setup.py自动安装。据说,有筒子32位的exe文件在64位系统上也能用,我就不试了,按照官方的指导来吧,免得以后出些莫名其妙的问题。
![](http://f.dataguru.cn/farattach/forum/201212/05/234335ybeysb990s0n9yyq.jpg)
打开http://peak.telecommunity.com/dist/ez_setup.py,把页面上的代码copy一份保存为ez_setup.py,也可以下载:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201306/a005791717a3fab87e843ad55ccf5be2.gif)
ez_setup.rar (3.78
KB, 下载次数: 1, 售价: 1 金子)
在命令行窗口下执行即可,前提是可以联网。
![](http://f.dataguru.cn/farattach/forum/201212/05/2349078uxeoux2b8enezbn.jpg)
D:\>ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to d:\python27\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to D:\Python27\Scripts
Installing easy_install.exe script to D:\Python27\Scripts
Installing easy_install.exe.manifest script to D:\Python27\Scripts
Installing easy_install-2.7-script.py script to D:\Python27\Scripts
Installing easy_install-2.7.exe script to D:\Python27\Scripts
Installing easy_install-2.7.exe.manifest script to D:\Python27\Scripts
Installed d:\python27\lib\site-packages\setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
复制代码
setuptools安装完成后的目录如下:
![](http://f.dataguru.cn/farattach/forum/201212/05/234335kc3v2ks1h4mjm25c.jpg)
5.为setuptools配置环境变量
![](http://f.dataguru.cn/farattach/forum/201212/05/234336sey6ssrx1ssesuke.jpg)
6.使用easy_install
安装django:
C:\Users\Biao>easy_install
error: No urls, filenames, or requirements specified (see --help)
C:\Users\Biao>easy_install django
Searching for django
Reading http://pypi.python.org/simple/django/
Reading http://www.djangoproject.com/
Reading http://www.djangoproject.com/m/bad-installer.txt
Best match: Django 1.4.2
Downloading https://www.djangoproject.com/m/releases/1.4/Django-1.4.2.tar.gz
Processing Django-1.4.2.tar.gz
Running Django-1.4.2\setup.py -q bdist_egg --dist-dir c:\users\biao\appdata\local\temp\easy_install-tahhsu\Django-1.4.2\egg-dist-tmp-0hpiac
zip_safe flag not set; analyzing archive contents...
django.contrib.admindocs.views: module references __file__
django.contrib.auth.tests.context_processors: module references __file__
django.contrib.auth.tests.forms: module references __file__
django.contrib.auth.tests.views: module references __file__
django.contrib.flatpages.tests.csrf: module references __file__
django.contrib.flatpages.tests.middleware: module references __file__
django.contrib.flatpages.tests.templatetags: module references __file__
django.contrib.flatpages.tests.views: module references __file__
django.contrib.formtools.tests.__init__: module references __file__
django.contrib.formtools.tests.wizard.namedwizardtests.tests: module references __file__
django.contrib.formtools.tests.wizard.wizardtests.tests: module references __file__
django.contrib.gis.geometry.test_data: module references __file__
django.contrib.gis.tests.geo3d.tests: module references __file__
django.contrib.gis.tests.geogapp.tests: module references __file__
django.contrib.gis.tests.layermap.tests: module references __file__
django.contrib.sitemaps.tests.base: module references __file__
django.contrib.staticfiles.storage: module references __file__
django.core.management.sql: module references __file__
django.core.management.templates: module references __path__
django.core.management.__init__: module references __file__
django.core.management.__init__: module references __path__
django.core.management.commands.loaddata: module references __file__
django.core.management.commands.loaddata: module references __path__
django.core.management.commands.makemessages: module references __file__
django.core.servers.basehttp: module references __path__
django.db.utils: module references __file__
django.db.models.loading: module references __file__
django.template.loaders.app_directories: module references __file__
django.test._doctest: module references __file__
django.test._doctest: module MAY be using inspect.getsourcefile
django.utils.autoreload: module references __file__
django.utils.module_loading: module references __path__
django.utils.version: module references __path__
django.utils.translation.trans_real: module references __file__
django.utils.translation.__init__: module references __file__
django.utils.unittest.collector: module references __file__
django.utils.unittest.loader: module references __file__
django.views.i18n: module references __file__
Adding django 1.4.2 to easy-install.pth file
Installing django-admin.py script to D:\Python27\Scripts
Installed d:\python27\lib\site-packages\django-1.4.2-py2.7.egg
Processing dependencies for django
Finished processing dependencies for django
C:\Users\Biao>python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> exit()
复制代码
django已安装成功。
安装numpy:
![](http://f.dataguru.cn/farattach/forum/201212/05/2343361oyffhozzzd1fyfy.jpg)
C:\Users\Biao>easy_install numpy
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Reading http://numeric.scipy.org
Best match: numpy 1.6.2
Downloading http://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee
error: MD5 validation failed for numpy-1.6.2.zip; possible download problem?
C:\Users\Biao>
复制代码
easy-install方式安装失败,这是因为我公司限网了,下载不下了。改用exe文件安装,安装文件为: numpy-unoptimized-1.6.2.win-amd64-py2.7.exe。下载完成后直接运行就可以了:
![](http://f.dataguru.cn/farattach/forum/201212/05/234337qudoz086j3hkpk0p.jpg)
默认会找到Python的安装路径:
![](http://f.dataguru.cn/farattach/forum/201212/05/234337egxu8xzqxxkducgf.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234338749lpcpilpqrfifi.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/2343390qzqt9knni20la8c.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234339yzv7uejtvl8veo2t.jpg)
numpy安装成功。
至此,在Windows下Python环境搭建完成。
原文地址:http://f.dataguru.cn/thread-36396-1-1.html
http://f.dataguru.cn/forum.php?mod=viewthread&tid=36405&fromuid=4771
系统环境
电脑型号 联想 ThinkPadT410 笔记本电脑
操作系统 Windows 7 旗舰版 64位 SP1 (DirectX 11 )
处理器 英特尔 Core i5 M560 @ 2.67GHz 双核笔记本处理器
主板 联想 2522NT7 (英特尔 QM57 芯片组)
内存 6 GB ( 尔必达 DDR31067MHz / 尔必达 DDR3 1333MHz )
1.下载
Python:
地址:http://www.python.org/getit/
版本:python-2.7.3.amd64.msi
setuptools:http://pypi.python.org/pypi/setuptools#windows
ez_setup.py文件:http://peak.telecommunity.com/dist/ez_setup.py
numpy:
地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/
版本:numpy-unoptimized-1.6.2.win-amd64-py2.7.exe
2.安装Python
![](http://f.dataguru.cn/farattach/forum/201212/05/2343328d7mmznvkdkzgt63.jpg)
选择安装路径:
![](http://f.dataguru.cn/farattach/forum/201212/05/234333a3aoxqp4aywae7w6.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234333q0i2zqq033rn0zq9.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234334abx7tutff7x22fse.jpg)
除了选择安装路径外,其他的基本都可以默认了,一直到安装完成。此时的目录结构如下:
![](http://f.dataguru.cn/farattach/forum/201212/05/234334irxoyun1j99zu9nn.jpg)
3为Python配置环境变量
![](http://f.dataguru.cn/farattach/forum/201212/05/234334bppmbeji8sb2gvj3.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234335f09p7r7901pg175k.jpg)
测试,Python安装成功。
4.安装setuptools
官网声称.exe版本的不支持64位Windows系统,推荐使用ez_setup.py自动安装。据说,有筒子32位的exe文件在64位系统上也能用,我就不试了,按照官方的指导来吧,免得以后出些莫名其妙的问题。
![](http://f.dataguru.cn/farattach/forum/201212/05/234335ybeysb990s0n9yyq.jpg)
打开http://peak.telecommunity.com/dist/ez_setup.py,把页面上的代码copy一份保存为ez_setup.py,也可以下载:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201306/a005791717a3fab87e843ad55ccf5be2.gif)
ez_setup.rar (3.78
KB, 下载次数: 1, 售价: 1 金子)
在命令行窗口下执行即可,前提是可以联网。
![](http://f.dataguru.cn/farattach/forum/201212/05/2349078uxeoux2b8enezbn.jpg)
D:\>ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to d:\python27\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to D:\Python27\Scripts
Installing easy_install.exe script to D:\Python27\Scripts
Installing easy_install.exe.manifest script to D:\Python27\Scripts
Installing easy_install-2.7-script.py script to D:\Python27\Scripts
Installing easy_install-2.7.exe script to D:\Python27\Scripts
Installing easy_install-2.7.exe.manifest script to D:\Python27\Scripts
Installed d:\python27\lib\site-packages\setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
复制代码
setuptools安装完成后的目录如下:
![](http://f.dataguru.cn/farattach/forum/201212/05/234335kc3v2ks1h4mjm25c.jpg)
5.为setuptools配置环境变量
![](http://f.dataguru.cn/farattach/forum/201212/05/234336sey6ssrx1ssesuke.jpg)
6.使用easy_install
安装django:
C:\Users\Biao>easy_install
error: No urls, filenames, or requirements specified (see --help)
C:\Users\Biao>easy_install django
Searching for django
Reading http://pypi.python.org/simple/django/
Reading http://www.djangoproject.com/
Reading http://www.djangoproject.com/m/bad-installer.txt
Best match: Django 1.4.2
Downloading https://www.djangoproject.com/m/releases/1.4/Django-1.4.2.tar.gz
Processing Django-1.4.2.tar.gz
Running Django-1.4.2\setup.py -q bdist_egg --dist-dir c:\users\biao\appdata\local\temp\easy_install-tahhsu\Django-1.4.2\egg-dist-tmp-0hpiac
zip_safe flag not set; analyzing archive contents...
django.contrib.admindocs.views: module references __file__
django.contrib.auth.tests.context_processors: module references __file__
django.contrib.auth.tests.forms: module references __file__
django.contrib.auth.tests.views: module references __file__
django.contrib.flatpages.tests.csrf: module references __file__
django.contrib.flatpages.tests.middleware: module references __file__
django.contrib.flatpages.tests.templatetags: module references __file__
django.contrib.flatpages.tests.views: module references __file__
django.contrib.formtools.tests.__init__: module references __file__
django.contrib.formtools.tests.wizard.namedwizardtests.tests: module references __file__
django.contrib.formtools.tests.wizard.wizardtests.tests: module references __file__
django.contrib.gis.geometry.test_data: module references __file__
django.contrib.gis.tests.geo3d.tests: module references __file__
django.contrib.gis.tests.geogapp.tests: module references __file__
django.contrib.gis.tests.layermap.tests: module references __file__
django.contrib.sitemaps.tests.base: module references __file__
django.contrib.staticfiles.storage: module references __file__
django.core.management.sql: module references __file__
django.core.management.templates: module references __path__
django.core.management.__init__: module references __file__
django.core.management.__init__: module references __path__
django.core.management.commands.loaddata: module references __file__
django.core.management.commands.loaddata: module references __path__
django.core.management.commands.makemessages: module references __file__
django.core.servers.basehttp: module references __path__
django.db.utils: module references __file__
django.db.models.loading: module references __file__
django.template.loaders.app_directories: module references __file__
django.test._doctest: module references __file__
django.test._doctest: module MAY be using inspect.getsourcefile
django.utils.autoreload: module references __file__
django.utils.module_loading: module references __path__
django.utils.version: module references __path__
django.utils.translation.trans_real: module references __file__
django.utils.translation.__init__: module references __file__
django.utils.unittest.collector: module references __file__
django.utils.unittest.loader: module references __file__
django.views.i18n: module references __file__
Adding django 1.4.2 to easy-install.pth file
Installing django-admin.py script to D:\Python27\Scripts
Installed d:\python27\lib\site-packages\django-1.4.2-py2.7.egg
Processing dependencies for django
Finished processing dependencies for django
C:\Users\Biao>python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> exit()
复制代码
django已安装成功。
安装numpy:
![](http://f.dataguru.cn/farattach/forum/201212/05/2343361oyffhozzzd1fyfy.jpg)
C:\Users\Biao>easy_install numpy
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Reading http://numeric.scipy.org
Best match: numpy 1.6.2
Downloading http://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee
error: MD5 validation failed for numpy-1.6.2.zip; possible download problem?
C:\Users\Biao>
复制代码
easy-install方式安装失败,这是因为我公司限网了,下载不下了。改用exe文件安装,安装文件为: numpy-unoptimized-1.6.2.win-amd64-py2.7.exe。下载完成后直接运行就可以了:
![](http://f.dataguru.cn/farattach/forum/201212/05/234337qudoz086j3hkpk0p.jpg)
默认会找到Python的安装路径:
![](http://f.dataguru.cn/farattach/forum/201212/05/234337egxu8xzqxxkducgf.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234338749lpcpilpqrfifi.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/2343390qzqt9knni20la8c.jpg)
![](http://f.dataguru.cn/farattach/forum/201212/05/234339yzv7uejtvl8veo2t.jpg)
numpy安装成功。
至此,在Windows下Python环境搭建完成。
原文地址:http://f.dataguru.cn/thread-36396-1-1.html
相关文章推荐
- Windows下Python环境搭建(包括Win7 64位下安装setuptools)
- Windows下Python环境搭建(包括Win7 64位下安装setuptools)
- windows7搭建基于VIM的开发环境(2)-编译64位且支持python的VIM版本并安装
- win7(64位)平台下Cygwin+Eclipse搭建Hadoop单机开发环境 (一) Cygwin(64位)的安装 + ssh的配置
- Windows环境下安装Python2.x环境搭建
- Windows 7(64位)搭建Python开发环境
- ASP---环境搭建,win7 64位iis安装
- Win7下搭建python开发环境图文教程(安装Python、pip、解释器)
- Linux 学习一 搭建环境系列之二 安装 python3.6、setuptools、pip
- win7 64位环境下python第三方函数库安装
- win7(64位)平台下Cygwin+Eclipse搭建Hadoop单机开发环境 (二) Hadoop的安装
- Windows 7 安装64位 Python 2.7.3 开发环境
- python+selenium环境搭建(包括常用类库、工具安装及资源下载地址)
- win7 64位 eclipse集成python搭建opengl环境
- selenium python 环境搭建(64位 windows)
- Windows系统的Python2.7和Python3.5环境搭建以及Pycharm2017.1.1的安装,Mac的Pycharm下载
- Python 安装以及WINDOWS环境下IDE搭建
- Python在Windows系统下安装环境的搭建
- 64位Win7下安装并配置Python2.7机器学习环境
- python安装与windows开发环境搭建