Can't install python Polyglot package on Windows
Asked Answered
G

5

10

I'm trying to install Polyglot package by using the command:

pip install polyglot

and I receive the following:

Collecting polyglot
  Using cached polyglot-15.10.03-py2.py3-none-any.whl
Collecting pycld2>=0.3 (from polyglot)
Requirement already satisfied (use --upgrade to upgrade): futures>=2.1.6 in d:\program files\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages (from polyglot)
Requirement already satisfied (use --upgrade to upgrade): wheel>=0.23.0 in d:\program files\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages (from polyglot)
Collecting PyICU>=1.8 (from polyglot)
  Using cached PyICU-1.9.3.tar.gz
Collecting morfessor>=2.0.2a1 (from polyglot)
Requirement already satisfied (use --upgrade to upgrade): six>=1.7.3 in d:\program files\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages (from polyglot)
Building wheels for collected packages: PyICU
  Running setup.py bdist_wheel for PyICU ... error
  Complete output from command "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\revuze\\AppData\\Local\\Temp\\pip-build-h2bmp43j\\PyICU\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\revuze\AppData\Local\Temp\tmpphoimlejpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.4
  copying icu.py -> build\lib.win-amd64-3.4
  copying PyICU.py -> build\lib.win-amd64-3.4
  copying docs.py -> build\lib.win-amd64-3.4
  running build_ext
  building '_icu' extension
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\revuze\AppData\Local\Temp\pip-build-h2bmp43j\PyICU\setup.py", line 115, in <module>
      py_modules=['icu', 'PyICU', 'docs'])
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\wheel\bdist_wheel.py", line 179, in run
      self.run_command('build')
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\build.py", line 126, in run
      self.run_command(cmd_name)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\command\build_ext.py", line 49, in run
      _build_ext.run(self)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\Cython\Distutils\build_ext.py", line 164, in run
      _build_ext.build_ext.run(self)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\build_ext.py", line 339, in run
      self.build_extensions()
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\Cython\Distutils\build_ext.py", line 172, in build_extensions
      self.build_extension(ext)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\command\build_ext.py", line 174, in build_extension
      _build_ext.build_extension(self, ext)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\build_ext.py", line 503, in build_extension
      depends=ext.depends)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\msvc9compiler.py", line 460, in compile
      self.initialize()
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\msvc9compiler.py", line 371, in initialize
      vc_env = query_vcvarsall(VERSION, plat_spec)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\msvc9_support.py", line 52, in query_vcvarsall
      return unpatched['query_vcvarsall'](version, *args, **kwargs)
    File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
      raise ValueError(str(list(result.keys())))
  ValueError: ['path']

  ----------------------------------------
  Failed building wheel for PyICU
  Running setup.py clean for PyICU
Failed to build PyICU
Installing collected packages: pycld2, PyICU, morfessor, polyglot
  Running setup.py install for PyICU ... error
    Complete output from command "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\revuze\\AppData\\Local\\Temp\\pip-build-h2bmp43j\\PyICU\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\revuze\AppData\Local\Temp\pip-lkjedrat-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.4
    copying icu.py -> build\lib.win-amd64-3.4
    copying PyICU.py -> build\lib.win-amd64-3.4
    copying docs.py -> build\lib.win-amd64-3.4
    running build_ext
    building '_icu' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\revuze\AppData\Local\Temp\pip-build-h2bmp43j\PyICU\setup.py", line 115, in <module>
        py_modules=['icu', 'PyICU', 'docs'])
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\install.py", line 539, in run
        self.run_command('build')
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\build.py", line 126, in run
        self.run_command(cmd_name)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\command\build_ext.py", line 49, in run
        _build_ext.run(self)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\Cython\Distutils\build_ext.py", line 164, in run
        _build_ext.build_ext.run(self)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\build_ext.py", line 339, in run
        self.build_extensions()
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\Cython\Distutils\build_ext.py", line 172, in build_extensions
        self.build_extension(ext)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\command\build_ext.py", line 174, in build_extension
        _build_ext.build_extension(self, ext)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\command\build_ext.py", line 503, in build_extension
        depends=ext.depends)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\msvc9compiler.py", line 460, in compile
        self.initialize()
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\msvc9compiler.py", line 371, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\setuptools\msvc9_support.py", line 52, in query_vcvarsall
        return unpatched['query_vcvarsall'](version, *args, **kwargs)
      File "D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: ['path']

    ----------------------------------------
Command ""D:\Program Files\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\revuze\\AppData\\Local\\Temp\\pip-build-h2bmp43j\\PyICU\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\revuze\AppData\Local\Temp\pip-lkjedrat-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\revuze\AppData\Local\Temp\pip-build-h2bmp43j\PyICU\

At first I had a problem with the C++ Compiler which I resolved and now I get this problem. Iv'e searched for similar issues and most of the comments recommend to install Microsoft Windows SDK (in order to resolve a 64 bits issue with the compiler) which I did without luck.

I'm working on Windows 10 64 machine on Python 3.4.

Gauffer answered 29/5, 2016 at 16:31 Comment(2)
Did you check #19610020 ? it looks related albeit old ... but same path entry missing ...Peery
github.com/aboSamoor/polyglot/issues/91#issuecomment-281948218 here is the answer for this question. Worked for me.Forgiveness
C
24

Sadly the package is not yet stable when it comes to Windows. After trying pip and conda install without luck. This is what I did to get it to work on Python 3.6 environment running on Windows 10 64 bit.

I had Visual C++ 2015 Build Tools(includes Windows SDK) via VS 2015 Community version and Numpy already installed.

I downloaded the correct dependence packages(PyICU and pycld2) from Unofficial Windows Binaries for Python Extension Packages and:

pip install PyICU-1.9.8-cp36-cp36m-win_amd64.whl
pip install pycld2-0.31-cp36-cp36m-win_amd64.whl

So cp36 matches my Python env.version, win for Windows, and amd64 for 64bits. Download the correct wheel that matches your systems.

After that I cloned and install the package from GitHub

git clone https://github.com/aboSamoor/polyglot.git
cd polyglot
python setup.py install
Columbic answered 2/1, 2018 at 6:11 Comment(4)
Thank you, this works. I was able to install polyglot in my machine without any errors. But when i try to run the tests, it says unable to import polyglot. Do you have any idea what might be causing the error?Inerney
Which Python version(s) are you using? Do you have multiple Pythons in your system? When you do: where pip, what path does it give you?Columbic
I did install the above mentioned two packages, and saved the github tar.gz file locally on my drive, now i get the error: no matching distribution found for future>2.1.6 any ideas for thatAlphorn
for me it's throwing error This backport is meant only for Python 2. It does not work on Python 3, and Python 3 users do not need it as the concurrent.futures package is available in the standard library. For projects that work on both Python 2 and 3, the dependency needs to be conditional on the Python version, like so: extras_require={':python_version == "2.7"': ['futures']} error: Setup script exited with 1Pullet
S
3

So if you want to install polyglot do follow steps:

Use git to install polyglot if you don't have then conda install git and then use this command

pip install git+https://github.com/aboSamoor/polyglot@master

the file will be automatically downloaded from this site, don't have to install again.

Semiweekly answered 16/1, 2020 at 9:9 Comment(0)
L
1

Best way is to download from https://github.com/aboSamoor/polyglot/tarball/master and then

python pip install aboSamoor-polyglot-15.10.03-69-gaf5059f.tar.gz
Lunnete answered 15/5, 2020 at 2:47 Comment(0)
K
0

If you have now Windows vs2010 compiler, you may try this:

  • launch "D:\Program Files\WinPython-64bit-3.4.4.2\make_cython_use_vc.bat"
  • then launch "Winpython Command Prompt" and "pip install polyglot"

If it fails, to revert to previous situation:

  • launch "D:\Program Files\WinPython-64bit-3.4.4.2\make_cython_use_mingw.bat"
Kershner answered 30/5, 2016 at 16:23 Comment(0)
T
-2

As I suspect that you do not have good experience compiling code on Windows it could be a better for your to try the use of Anaconda python distribution which has most of the Python packages already compiled.

Once install you just use conda instead of pip to install new packages. You can still use pip if you have to.

Terle answered 29/5, 2016 at 17:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.