2013-01-08 104 views
2

我真的很陌生,可以安裝Python和相關軟件包的使用。 作爲一名生物學家,我正在尋找很多可以幫助我模擬物種系統,生態變化等的新軟件包。在經歷了很多「Google-ing」之後,我遇到了scikit-learn。 但是,我在安裝時遇到問題。我現在要花點時間爲這篇文章的篇幅道歉。在Windows 7上安裝python 3.3的scikit-learn

我使用的是64位Python 3.3,並且有關聯的NumPy(MKL 1.7.0)和SciPy。我安裝了可以正常工作的分發版,並允許我使用easy_install。 因此,要安裝scikit-learn,我嘗試使用以管理員模式運行的cmd提示符(Windows),然後還通過Python命令行運行。 我將下載並提取的tar.gz文件放在Lib \ site-packages文件夾中。 當我在cmd提示符下運行命令 easy_install scikit-learn 。 那麼這就是下面的輸出:

C:\Python33\Lib\site-packages>easy_install -U scikit-learn 
Searching for scikit-learn 
Reading http://pypi.python.org/simple/scikit-learn/ 
Reading http://scikit-learn.org 
Reading http://sourceforge.net/projects/scikit-learn/files/ 
Reading http://scikit-learn.sourceforge.net 
Best match: scikit-learn 0.12.1 
Downloading http://pypi.python.org/packages/source/s/scikit-learn/scikit-learn-0 
.12.1.tar.gz#md5=7e8b3434f9e8198b82dc3774f8bc9394 
Processing scikit-learn-0.12.1.tar.gz 
Writing c:\users\nuvraj~1\appdata\local\temp\easy_install-kvr2q0\scikit-learn-0. 
12.1\setup.cfg 
Running scikit-learn-0.12.1\setup.py -q bdist_egg --dist-dir c:\users\nuvraj~1\a 
ppdata\local\temp\easy_install-kvr2q0\scikit-learn-0.12.1\egg-dist-tmp-l618ie 
Traceback (most recent call last): 
    File "C:\Python33\Scripts\easy_install-script.py", line 9, in <module> 
    load_entry_point('distribute==0.6.33', 'console_scripts', 'easy_install')() 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
1937, in main 
    with_ei_usage(lambda: 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
1918, in with_ei_usage 
    return f() 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
1941, in <lambda> 
    distclass=DistributionWithoutHelpCommands, **kw 
    File "C:\Python33\lib\distutils\core.py", line 148, in setup 
    dist.run_commands() 
    File "C:\Python33\lib\distutils\dist.py", line 917, in run_commands 
    self.run_command(cmd) 
    File "C:\Python33\lib\distutils\dist.py", line 936, in run_command 
    cmd_obj.run() 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
358, in run 
    self.easy_install(spec, not self.no_deps) 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
598, in easy_install 
    return self.install_item(spec, dist.location, tmpdir, deps) 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
628, in install_item 
    dists = self.install_eggs(spec, download, tmpdir) 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
823, in install_eggs 
    return self.build_and_install(setup_script, setup_base) 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
1103, in build_and_install 
    self.run_setup(setup_script, setup_base, args) 
    File "C:\Python33\lib\site-packages\setuptools\command\easy_install.py", line 
1089, in run_setup 
    run_setup(setup_script, args) 
    File "C:\Python33\lib\site-packages\setuptools\sandbox.py", line 34, in run_se 
tup 
    lambda: exec(compile(open(
    File "C:\Python33\lib\site-packages\setuptools\sandbox.py", line 82, in run 
    return func() 
    File "C:\Python33\lib\site-packages\setuptools\sandbox.py", line 37, in <lambd 
a> 
    {'__file__':setup_script, '__name__':'__main__'}) 
    File "setup.py", line 33, in <module> 
    File "c:\users\nuvraj~1\appdata\local\temp\easy_install-kvr2q0\scikit-learn-0. 
12.1\sklearn\__init__.py", line 86 
    print "I: Seeding RNGs with %r" % _random_seed 
           ^
SyntaxError: invalid syntax 

C:\Python33\Lib\site-packages> 

於是小^似乎在被指向「後,用%R的RNG從我可以告訴是從sklearn的‘初始化’文件。文件夾中的.tar.gz文件中。

我在Python GUI和命令行運行時,它也得到了同樣的結果。

如何安裝與Python 3.3 scikit學習?有沒有一些方法構建它還是編輯文件以通過這個無效的語法錯誤?

任何幫助將不勝感激。我非常抱歉這是一個很長的帖子。我只是想弄清楚那裏的所有細節。

感謝 西蒙

回答

2

scikit學習不支持Python 3裏呢。現在你需要Python 2.7。

對於計劃於2013年第二季度發佈的0.14版本,預計會適當支持Python 3。

+0

確定。謝謝。我會繼續檢查更新的版本,並感謝所有的辛勤工作 – SimSang

0

我不是專家,但我理解Python 3中的打印語句。*現在是一個函數,名爲like:print()。所以,在這種情況下,快速的解決辦法是改變

print "I: Seeding RNGs with %r" % _random_seed 

print("I: Seeding RNGs with %r" % _random_seed)