WannaBeCoder
WannaBeCoder

Reputation: 1282

Difficulty installing Gensim using from source and pip

I am trying to install Gensim which I downloaded from this site. The installation using pip is also not working for me. I am getting the error below.

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

I have seen the same question in stackoverflow. I also did what was mentioned in this question. I have installed Microsoft c++ compiler for python 2.7. Is there any windows binary for Gensim? How can I install it.

Upvotes: 1

Views: 1702

Answers (2)

Camron_Godbout
Camron_Godbout

Reputation: 1633

In my opinion the easiest way to get gensim configured on my windows machine was to download portable python from here then open up command prompt to the directory of PortablePython/App/Scripts and then easy_install.exe gensim

Upvotes: 0

forwardwang
forwardwang

Reputation: 11

download VCForPython27,find the file :'C:/Users/Forward(ur username)/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0/vcvarsall.bat'

find this file msvc9compiler.py in c:/python27(ur dir)/Lib/distutils,get this function and change the function as follows,directly point to this file!

def find_vcvarsall(version):

"""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

Upvotes: 1

Related Questions