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

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容