Linux系统参考:Linux下Python环境搭建
http://f.dataguru.cn/forum.php?mod=viewthread&tid=36405&fromuid=4771
1.下载
Python:
地址:http://www.python.org/getit/
版本:python-2.7.6.amd64.msi
ez_setup.py文件:
blog.victorjabur.com/2011/06/08/modules-python-library-compiled-for-windows-32-and-64-unofficial-windows-binaries-for-python/
MySQL-python-1.2.3.win-amd64-py2.7.exe [1.1 Mb] [Python 2.7] [64 bit] [JUN 08, 2011]
时,在注册表中已经有了一个目录,仿照这个目录,我在注册表中将目录改为了G:\StudyingSoft\Python2.7,真聪明!
http://www.crifan.com/python_install_module_mysql_mysqldb/
2.
安装Python
一直下一步到完成
3为Python配置环境变量


测试,Python安装成功。
4.安装easy_install
注意:win7 64位必须使用ez_setup.py进行安装。方法是下载ez_setup.py后,在cmd下执行 python ez_setup.py,即可自动安装setuptools。目前没有直接的exe安装版本。blog.youkuaiyun.com/dreamzml/article/details/8847879
setuptools安装完成后的目录如下:
5.为setuptools配置环境变量
安装twitter包
setup.py文件的使用:
% python setup.py build #编译
% python setup.py install #安装
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:
- 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。下载完成后直接运行就可以了:
默认会找到Python的安装路径:
numpy安装成功。
至此,在Windows下Python环境搭建完成。
从cmd中安装mysql的源码(MySQL-python-1.2.5.zip),python setup.py install ,出现error: Unable to find vcvarsall.bat 的错误