scikit-learn 安装 windows下安装scikit learn以及python的各种包 安装 setu

scikit-learn 安装 windows下安装scikit learn以及python的各种包 安装 setu

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

选择安装路径:

除了选择安装路径外,其他的基本都可以默认了,一直到安装完成。此时的目录结构如下:

3为Python配置环境变量

测试,Python安装成功。

4.安装setuptools

官网声称.exe版本的不支持64位Windows系统,推荐使用ez_setup.py自动安装。据说,有筒子32位的exe文件在64位系统上也能用,我就不试了,按照官方的指导来吧,免得以后出些莫名其妙的问题。

打开http://peak.telecommunity.com/dist/ez_setup.py,把页面上的代码copy一份保存为ez_setup.py,也可以下载:

ez_setup.rar(3.78 KB, 下载次数: 55, 售价: 1

金子)

在命令行窗口下执行即可,前提是可以联网。

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安装完成后的目录如下:

5.为setuptools配置环境变量

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环境搭建完成。

easy_installscikit-learn

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 157,198评论 4 359
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 66,663评论 1 290
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 106,985评论 0 237
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,673评论 0 202
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 51,994评论 3 285
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,399评论 1 211
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,717评论 2 310
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,407评论 0 194
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,112评论 1 239
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,371评论 2 241
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 31,891评论 1 256
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,255评论 2 250
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,881评论 3 233
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,010评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,764评论 0 192
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,412评论 2 269
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,299评论 2 260

推荐阅读更多精彩内容