2

Failed building wheel for hmmlearn Command "C:\Users\Akash\PycharmProjects\hello\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Akash\AppData\Local\Temp\pycharm-packaging\hmmlearn\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\Akash\AppData\Local\Temp\pip-record-z6k7p8b8\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Akash\PycharmProjects\hello\venv\include\site\python3.6\hmmlearn" failed with error code 1 in C:\Users\Akash\AppData\Local\Temp\pycharm-packaging\hmmlearn\

this is the error showing in cmd and in pycharm also. i found that Microsoft Visual Studio C++ 14 is required

amanb
  • 5,276
  • 3
  • 19
  • 38
Akash Munshi
  • 21
  • 1
  • 1
  • 6

6 Answers6

4

I had the same issue, asking me for Microsoft Visual Studio C++ 14 Build tools, I've tried every possible solution that I saw on Stackoverflow and github.
The only fix that worked form me is using the .whl file in https://www.lfd.uci.edu/~gohlke/pythonlibs/#hmmlearn and more importantly using a 32-bit version of the whl file (I just realized i was using 32bit Python3.6 while in a 64bit Win10 OS)

In the specific .venv folder, activate the environment and type:

pip install <yourdir>/hmmlearn‑0.2.1‑cp36‑cp36m‑win32.whl
Til
  • 5,150
  • 13
  • 26
  • 34
DonAriston
  • 101
  • 1
  • 5
2

There are two ways to fix problems with packages that need Microsoft Build tools:

1) Using the Anaconda package for Python. If your Python package was shipped with Anaconda, then you just need conda install hmmlearn. Personally, all package build errors are fixed for me using this.

2) If you have a standalone installation of Python, then follow the steps below to fix:

a) For Python 3.5, 3.6: Download and Install Microsoft Visual C++ Build Tools 2017.

b) On the Visual Studio Download page, scroll down and select Tools for Visual Studio 2017. Click on the Download button for Build Tools for Visual Studio 2017.

c) Restart your computer and try installing hmmlearn with pip install hmmlearn.

3) In some cases, where package build errors persist, you can consider building the package using wheels.

I hope this helps.

amanb
  • 5,276
  • 3
  • 19
  • 38
  • Command "c:\users\akash\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Akash\\AppData\\Local\\Temp\\pip-install-cl08vebc\\hmmlearn\\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\Akash\AppData\Local\Temp\pip-record-w9shcj_f\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Akash\AppData\Local\Temp\pip-install-cl08vebc\hmmlearn\ this is problem now – Akash Munshi Jun 24 '18 at 04:29
2

run anaconda prompt as administrator and try the following command "conda install -c conda-forge hmmlearn", that installs the package from another channel, or try any other channel from the link: https://anaconda.org/search?q=hmmlearn

Asma
  • 81
  • 4
1

I'm running Windows 10. The only channel and subsequent command that worked for me was conda-forge:

conda install -c conda-forge hmmlearn

0

I had the exact same issue - another source for the package which I wanted to install did it for me. For example 'conda install hmmlearn' would cause the issue above. But after checking anaconda.org for packages, I found the command 'conda install -c omnia hmmlearn' which solved the situation for me without any further Microsoft Visual C++ installation or action... Best, Lania

0

I faced the same issue for python 3.7. Downloading the wheel file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#hmmlearn fixed the issue for me.

I downloaded the hmmlearn‑0.2.1‑cp37‑cp37m‑win_amd64.whl (Since mine is a 64bit machine with python 3)

The github issue and fix for this can be found here https://github.com/hmmlearn/hmmlearn/issues/289

Niveditha Karmegam
  • 742
  • 11
  • 28