2014-12-23 2 views
1

this 사이트에서 다운로드 한 Gensim을 설치하려고합니다. pip를 사용하는 설치가 나를 위해 작동하지 않습니다. 아래 오류가 나타납니다.소스와 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 

나는을 stackoverflow에서 보았습니다. 나는 또한 this 질문에 언급 된 것을했다. Python 2.7 용 Microsoft C++ 컴파일러를 설치했습니다. Gensim 용 바이너리 윈도우가 있습니까? 어떻게 설치할 수 있습니까?

답변

1
VCForPython27이 파일 찾을

다운로드 : 'C : 파이썬/9.0/vcvarsall.bat에 대한/사용자/앞으로 (UR 사용자 이름) /의 AppData가/지역/프로그램/공통/마이크로 소프트/비주얼 C++의'

이를 찾을 수 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

가장 쉬운 방법은 gensim 내 윈도우 머신에 구성된 얻을 것은 here에서 휴대용 Python을 다운로드 한 후 다음 PortablePython/App/Scripts과의 디렉토리로 명령 프롬프트를 엽니 다 easy_install.exe gensim