2015-08-13 186 views
0

我有Windows 7和WinPython 3.4.3.2;試圖從http://www.lfd.uci.edu/~gohlke/pythonlibs/#gensim如何在Windows 7上安裝Gensim

我得到這個錯誤安裝Gensim:

C:\Program Files (x86)\PowerCmd>pip install e:\Python\gensim-0.12.1-cp34-none-win_amd64.whl 
You are using pip version 6.0.8, however version 7.1.0 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
Processing e:\python\gensim-0.12.1-cp34-none-win_amd64.whl 
Requirement already satisfied (use --upgrade to upgrade): six>=1.2.0 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages (from gensim==0.12.1) 
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.3 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages (from gensim==0.12.1) 
Collecting smart-open>=1.2.1 (from gensim==0.12.1) 
    Using cached smart_open-1.2.1.tar.gz 
Traceback (most recent call last): 
    File "<string>", line 20, in <module> 
    File "C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open\setup.py", line 28, in <module> 
    long_description = read('README.rst'), 
    File "C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open\setup.py", line 21, in read 
    return open(os.path.join(os.path.dirname(__file__), fname)).read() 
    File "M:\WinPython-64bit-3.4.3.2\python-3.4.3.amd64\lib\encodings\cp1251.py", line 23, in decode 
    return codecs.charmap_decode(input,self.errors,decoding_table)[0] 
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 4345: character maps to <undefined> 
    Traceback (most recent call last): 
     File "<string>", line 20, in <module> 
     File "C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open\setup.py", line 28, in <module> 
     long_description = read('README.rst'), 
     File "C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open\setup.py", line 21, in read 
     return open(os.path.join(os.path.dirname(__file__), fname)).read() 
     File "M:\WinPython-64bit-3.4.3.2\python-3.4.3.amd64\lib\encodings\cp1251.py", line 23, in decode 
     return codecs.charmap_decode(input,self.errors,decoding_table)[0] 
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 4345: character maps to <undefined> 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 

     File "<string>", line 20, in <module> 

     File "C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open\setup.py", line 28, in <module> 

     long_description = read('README.rst'), 

     File "C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open\setup.py", line 21, in read 

     return open(os.path.join(os.path.dirname(__file__), fname)).read() 

     File "M:\WinPython-64bit-3.4.3.2\python-3.4.3.amd64\lib\encodings\cp1251.py", line 23, in decode 

     return codecs.charmap_decode(input,self.errors,decoding_table)[0] 

    UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 4345: character maps to <undefined> 

    ---------------------------------------- 
    Command "python setup.py egg_info" failed with error code 1 in C:\Users\Joomler\AppData\Local\Temp\pip-build-49b17fh6\smart-open 

回答

0

我從setup.py手動安裝https://pypi.python.org/pypi/smart_open

有一個問題文件README.rst - 我刪除了其中的所有數據,以確保不會打印壞字符。

現在我需要手動安裝Gensim,因爲它會自動下載smart_open。不幸的是,我無法import gensim。我有以下錯誤:

ImportError: No module named 'gensim' 

但如果我執行pip install -U gensim我能看到所有的需求都已經滿足:

Requirement already up-to-date: gensim in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\gensim-0.12.1-py3.4-win-amd64.egg 
Requirement already up-to-date: numpy>=1.3 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages (from gensim) 
Requirement already up-to-date: scipy>=0.7.0 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages (from gensim) 
Requirement already up-to-date: six>=1.5.0 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages (from gensim) 
Requirement already up-to-date: smart-open>=1.2.1 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\smart_open-1.2.1-py3.4.egg (from gensim) 
Requirement already up-to-date: boto>=2.32 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\boto-2.38.0-py3.4.egg (from smart-open>=1.2.1->gensim) 
Requirement already up-to-date: httpretty==0.8.6 in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\httpretty-0.8.6-py3.4.egg (from smart-open>=1.2.1->gensim) 
Requirement already up-to-date: bz2file in m:\winpython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\bz2file-0.98-py3.4.egg (from smart-open>=1.2.1->gensim) 

任何提示?

編輯15/08/2015:安裝成功。我只需要清理舊的嘗試並重新安裝。

0

它也許,該錯誤信息顯示,「在Windows的兼容性錯誤一個Python3。

+0

我quess它是一種常見的UnicodeDecodeError錯誤,但如何解決 –

+0

這是由gensim(現在,等待下一個版本)的作者解決https://pypi.python.org/pypi/smart_open問題 –

+0

: https://github.com/piskvorky/gensim/issues/428 – stonebig