-->

Installing rasa on Windows

2019-02-20 20:37发布

问题:

I am trying to install rasa on Windows 10. I am done installing Python 3.6 and pip packege. When I am running pip install rasa_nlu I am getting the following error:

c:\program files (x86)\python36-32\include\pyconfig.h(222): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

I have tried most of the solutions like reinstalling Microsoft redistributables, installing build tools etc. but none of them worked.

回答1:

I also faced the similar issue. Here's how I resolved it:

For a clean install of RASA NLU with all other dependencies, I followed:

Anaconda 5.0.1 64-bit Windows for installing Python 3.6.3 interpreter: https://repo.continuum.io/archive/Anaconda3-5.0.1-Windows-x86_64.exe

& (If you are using Visual Studio 2015 then): Python Tools for Visual Studio 2015: https://ptvs.azureedge.net/download/PTVS%202.2.6%20VS%202015.msi

(If you are using Visual Studio 2017 then): Install Visual C++ 14.0 Runtime.

Next, install the following packages in this order in administrative mode in command prompt:

  1. Spacy Machine Learning Package: pip install -U spacy
  2. Spacy English Language Model: python -m spacy download en
  3. Scikit Package: pip install -U scikit-learn
  4. Numpy package for mathematical calculations: pip install -U numpy
  5. Scipy Package: pip install -U scipy
  6. Sklearn Package for Intent Recognition: pip install -U sklearn-crfsuite
  7. NER Duckling for better Entity Recognition with Spacy: pip install -U duckling
  8. RASA NLU: pip install -U rasa_nlu==0.10.4


回答2:

Short Answer:

Use a pre-compiled wheel bundle for the dependency failing to install. (This is an unofficial source so use at your own risk) Download here and do

pip install /path/to/bundle.whl

Long Answer:

I faced a similar problem while installing rasa_nlu and this is how I resolved it.

The major problem was in installing the Twisted package. I had tried installing redistributables and build tools and my final error looked like this-

c:\program files\python36\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory

    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

I then decided to follow the answer here which describes ways to handle python library installations in a fallback approach.

My final resolution was downloading the twisted wheel from the source mentioned above, install the package and continue with rasa installation.

pip install ./Twisted-17.9.0-cp36-cp36m-win_amd64.whl
pip install rasa_nlu

Note:

If you are really skeptic in using an unofficial source, follow the instructions in SF answer I shared earlier to build your own bundle and use that wheel for installation.