简体   繁体   中英

Unable to install hmmlearn in Python 3

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

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.

以管理员身份运行anaconda提示符,然后尝试以下命令“ conda install -c conda-forge hmmlearn”,该命令可从另一个渠道安装程序包,或从链接尝试任何其他渠道: https ://anaconda.org/search?q =学习

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

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

我正在运行Windows10。唯一对我有用的频道和后续命令是conda-forge:

conda install -c conda-forge hmmlearn

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM