2014-12-23 104 views
1

我想安裝Gensim,我從this網站下載。使用pip的安裝也不適合我。我收到下面的錯誤。使用源和點安裝Gensim困難

C:\Users\Anirudh\Downloads\gensim-0.10.3>python setup.py install 
running install 
running bdist_egg 
running egg_info 
writing requirements to gensim.egg-info\requires.txt 
writing gensim.egg-info\PKG-INFO 
writing top-level names to gensim.egg-info\top_level.txt 
writing dependency_links to gensim.egg-info\dependency_links.txt 
reading manifest file 'gensim.egg-info\SOURCES.txt' 
reading manifest template 'MANIFEST.in' 
warning: no files found matching '*.sh' under directory '.' 
no previously-included directories found matching 'docs\src*' 
writing manifest file 'gensim.egg-info\SOURCES.txt' 
installing library code to build\bdist.win-amd64\egg 
running install_lib 
running build_py 
running build_ext 
building 'gensim.models.word2vec_inner' extension 
Unable to find vcvarsall.bat 
an integer is required 
Traceback (most recent call last): 
    File "setup.py", line 166, in <module> 
    include_package_data=True, 
    File "C:\Python27\lib\distutils\core.py", line 151, in setup 
    dist.run_commands() 
    File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands 
    self.run_command(cmd) 
    File "C:\Python27\lib\distutils\dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com 
mand\install.py", line 73, in run 
    self.do_egg_install() 
    File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com 
mand\install.py", line 93, in do_egg_install 
    self.run_command('bdist_egg') 
    File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command 
    self.distribution.run_command(command) 
    File "C:\Python27\lib\distutils\dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com 
mand\bdist_egg.py", line 179, in run 
    cmd = self.call_command('install_lib', warn_dir=0) 
    File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com 
mand\bdist_egg.py", line 166, in call_command 
    self.run_command(cmdname) 
    File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command 
    self.distribution.run_command(command) 
    File "C:\Python27\lib\distutils\dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "C:\Python27\lib\site-packages\distribute-0.6.49-py2.7.egg\setuptools\com 
mand\install_lib.py", line 20, in run 
    self.build() 
    File "C:\Python27\lib\distutils\command\install_lib.py", line 111, in build 
    self.run_command('build_ext') 
    File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command 
    self.distribution.run_command(command) 
    File "C:\Python27\lib\distutils\dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "setup.py", line 71, in run 
    "There was an issue with your platform configuration - see above.") 
TypeError: an integer is required 

我已經在計算器中看到了same question。我也做了this問題中提到的問題。我已經爲python 2.7安裝了Microsoft C++編譯器。 Gensim有沒有Windows二進制文件?我怎樣才能安裝它。

回答

1

下載VCForPython27,找到該文件:C:/用戶/轉發(UR用戶名)/應用程序數據/本地/程序/通用/微軟/的Visual C++爲Python/9.0/vcvarsall.bat「

發現這在c:/ python27(ur dir)/ Lib/distutils文件msvc9compiler.py中,獲取該函數並按以下方式更改函數,直接指向該文件!

高清find_vcvarsall(版本):

"""Find the vcvarsall.bat file 

At first it tries to find the productdir of VS 2008 in the registry. If 
that fails it falls back to the VS90COMNTOOLS env var. 
""" 

vcvarsall = 'C:/Users/Forward(ur username)/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0/vcvarsall.bat' 
if os.path.isfile(vcvarsall): 
    return vcvarsall 
log.debug("Unable to find vcvarsall.bat") 
return None 
0

在我看來,最簡單的方法我的Windows機器上得到gensim配置是從here下載便攜式蟒然後打開命令提示符的PortablePython/App/Scripts然後將目錄easy_install.exe gensim