1

I am trying to install GloVe package from Pypi on Python version 3.7 but it keeps returning the same error written below. Is there any way to use GloVe? I have also tried to install it from https://github.com/stanfordnlp/GloVe but it also ends with error. Thank you for your help!

pip install glove Collecting glove   Using cached glove-1.0.2.tar.gz (44 kB) Requirement already satisfied: numpy in d:\anaconda\lib\site-packages (from glove) (1.16.4) Building wheels for collected packages: glove   Building wheel for glove (setup.py) ... error   ERROR: Command errored out with exit status 1:    command: 'd:\anaconda\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-vlqonr2u\\glove\\setup.py'"'"';
__file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-vlqonr2u\\glove\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Dell\AppData\Local\Temp\pip-wheel-c3ip0qox'
       cwd: C:\Users\Dell\AppData\Local\Temp\pip-install-vlqonr2u\glove\   Complete output (67 lines):   running bdist_wheel   running build   running build_py   creating build   creating build\lib.win-amd64-3.7   creating build\lib.win-amd64-3.7\glove   copying glove\glove.py -> build\lib.win-amd64-3.7\glove   copying glove\__init__.py -> build\lib.win-amd64-3.7\glove   running egg_info   writing glove.egg-info\PKG-INFO   writing dependency_links to glove.egg-info\dependency_links.txt   writing requirements to glove.egg-info\requires.txt   writing top-level names to glove.egg-info\top_level.txt   reading manifest file 'glove.egg-info\SOURCES.txt'   Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Dell\AppData\Local\Temp\pip-install-vlqonr2u\glove\setup.py", line 85, in <module>
      include_package_data=True,
    File "d:\anaconda\lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "d:\anaconda\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "d:\anaconda\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "d:\anaconda\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "d:\anaconda\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "d:\anaconda\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "d:\anaconda\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 53, in run
      self.build_package_data()
    File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 118, in build_package_data
      for package, src_dir, build_dir, filenames in self.data_files:
    File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 66, in __getattr__
      self.data_files = self._get_data_files()
    File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 82, in _get_data_files
      self.analyze_manifest()
    File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 138, in analyze_manifest
      self.run_command('egg_info')
    File "d:\anaconda\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 297, in run
      self.find_sources()
    File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 304, in find_sources
      mm.run()
    File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 535, in run
      self.add_defaults()
    File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 579, in add_defaults
      self.read_manifest()
    File "d:\anaconda\lib\site-packages\setuptools\command\sdist.py", line 220, in read_manifest
      self.filelist.append(line)
    File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 477, in append
      path = convert_path(item)
    File "d:\anaconda\lib\distutils\util.py", line 110, in convert_path
      raise ValueError("path '%s' cannot be absolute" % pathname)   ValueError: path '/Users/jonathanraiman/Desktop/Coding/python_packages/glove/glove/glove_inner.cpp' cannot be absolute   ----------------------------------------   ERROR: Failed building wheel for glove   Running setup.py clean for glove Failed to build glove Installing collected packages: glove
    Running setup.py install for glove ... error
    ERROR: Command errored out with exit status 1:
     command: 'd:\anaconda\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-vlqonr2u\\glove\\setup.py'"'"';
__file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-vlqonr2u\\glove\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Dell\AppData\Local\Temp\pip-record-mo9f0x8b\install-record.txt'
--single-version-externally-managed --compile --install-headers 'd:\anaconda\Include\glove'
         cwd: C:\Users\Dell\AppData\Local\Temp\pip-install-vlqonr2u\glove\
    Complete output (69 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\glove
    copying glove\glove.py -> build\lib.win-amd64-3.7\glove
    copying glove\__init__.py -> build\lib.win-amd64-3.7\glove
    running egg_info
    writing glove.egg-info\PKG-INFO
    writing dependency_links to glove.egg-info\dependency_links.txt
    writing requirements to glove.egg-info\requires.txt
    writing top-level names to glove.egg-info\top_level.txt
    reading manifest file 'glove.egg-info\SOURCES.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Dell\AppData\Local\Temp\pip-install-vlqonr2u\glove\setup.py", line 85, in <module>
        include_package_data=True,
      File "d:\anaconda\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "d:\anaconda\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "d:\anaconda\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "d:\anaconda\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "d:\anaconda\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "d:\anaconda\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "d:\anaconda\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "d:\anaconda\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 53, in run
        self.build_package_data()
      File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 118, in build_package_data
        for package, src_dir, build_dir, filenames in self.data_files:
      File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 66, in __getattr__
        self.data_files = self._get_data_files()
      File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 82, in _get_data_files
        self.analyze_manifest()
      File "d:\anaconda\lib\site-packages\setuptools\command\build_py.py", line 138, in analyze_manifest
        self.run_command('egg_info')
      File "d:\anaconda\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "d:\anaconda\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 297, in run
        self.find_sources()
      File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 304, in find_sources
        mm.run()
      File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 535, in run
        self.add_defaults()
      File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 579, in add_defaults
        self.read_manifest()
      File "d:\anaconda\lib\site-packages\setuptools\command\sdist.py", line 220, in read_manifest
        self.filelist.append(line)
      File "d:\anaconda\lib\site-packages\setuptools\command\egg_info.py", line 477, in append
        path = convert_path(item)
      File "d:\anaconda\lib\distutils\util.py", line 110, in convert_path
        raise ValueError("path '%s' cannot be absolute" % pathname)
    ValueError: path '/Users/jonathanraiman/Desktop/Coding/python_packages/glove/glove/glove_inner.cpp' cannot be absolute
    ---------------------------------------- ERROR: Command errored out with exit status 1: 'd:\anaconda\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-vlqonr2u\\glove\\setup.py'"'"';
__file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-vlqonr2u\\glove\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Dell\AppData\Local\Temp\pip-record-mo9f0x8b\install-record.txt'
--single-version-externally-managed --compile --install-headers 'd:\anaconda\Include\glove' Check the logs for full command output.<
zmag
  • 7,825
  • 12
  • 32
  • 42
Black
  • 13
  • 1
  • 4
  • Are you trying to build it in Windows? Perhaps you have to use a linux system. And please add line feeds for the output log to make it readable – Zealseeker Feb 16 '20 at 22:36
  • Yes, I use Windows. I am not really sure if this is what you ask for, but in my LOG_FILE, I've found: `2020-02-17T01:42:40,430 File "d:\anaconda\lib\distutils\util.py", line 110, in convert_path 2020-02-17T01:42:40,430 raise ValueError("path '%s' cannot be absolute" % pathname) 2020-02-17T01:42:40,430 ValueError: path '/Users/jonathanraiman/Desktop/Coding/python_packages/glove/glove/glove_inner.cpp' cannot be absolute 2020-02-17T01:42:40,498 ERROR: Failed building wheel for glove 2020-02-17T01:42:40,500 Running setup.py clean for glove` – Black Feb 16 '20 at 23:48
  • Have you tried conda? – Ke Zhang Feb 17 '20 at 01:16
  • Do you mean "conda install glove"? I've tried it, but glove is a package from a library and I haven't find so far another way to use conda for installing a package – Black Feb 17 '20 at 01:53
  • @Black you need @ me to allow stackoverflow send me notification – Ke Zhang Feb 17 '20 at 02:30

2 Answers2

0

If you're okay with a slight modification on the original GloVe implementation, you can use "mittens". It was uses the same algorithm as GloVe, but vectorizes the objective function and also utilizes a "warm start" (mittens are warmer than gloves).

From the docs: mittens starts with the general-purpose pretrained representations and tunes them to a specialized domain.
pip install -U mittens
then:
from mittens import GloVe

https://github.com/roamanalytics/mittens#mittens

David Kaspar
  • 96
  • 1
  • 3
  • just wanted to add that think `from mittens import GloVe` gives the exact algorithm as described in the Stanford package. If you want the "warm-start" thing, that's a different class: `from mittens import Mittens` – David Kaspar Sep 03 '20 at 18:12
-1

You could source install it. clone it from github then

pip install .
Ke Zhang
  • 937
  • 1
  • 10
  • 24
  • I've been trying to do that but it returns `ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.` I've also installed python on git but that doesn't work either – Black Feb 18 '20 at 07:59
  • @Black The link in your question isn't Pypi package source file. Check this https://github.com/JonathanRaiman/glove – Ke Zhang Feb 18 '20 at 08:32
  • I've cloned that repo ( [link] github.com/JonathanRaiman/glove ) and then `pip install . `but now I have this error `ImportError: Building module glove.glove_inner failed: ['distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat\n']` . According to https://bugs.python.org/issue35699 it is a bug that has been solved.. – Black Feb 18 '20 at 16:04
  • @Black What exact version of your python 3.7 are you using. Could you upgrade to 3.7.3+ – Ke Zhang Feb 18 '20 at 17:53
  • I work on 3.7.3. I've tried to downgrade it but nothing happened. – Black Feb 19 '20 at 15:57