在Windows上安装rasa

问题描述 投票:1回答:2

我正在尝试在Windows 10上安装rasa。我已经完成了安装Python 3.6和pip packege。当我运行pip install rasa_nlu时,我收到以下错误:

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

我已经尝试了大多数解决方案,如重新安装Microsoft可再发行组件,安装构建工具等,但它们都没有工作。

python windows visual-studio nlp rasa-nlu
2个回答
5
投票

我也遇到过类似的问题。这是我如何解决它:

要在具有所有其他依赖项的Windows计算机上彻底安装RASA NLU,我执行了以下步骤:

C:\Anaconda3中安装Anaconda时,因为在C:\ProgramData\Anaconda3中安装它会在安装一些pip包时导致一些文件夹锁定问题。

enter image description here

安装JDKJRE并设置JAVA_HOME环境变量,因为RASA NLU需要的Duckling Date Parser需要JVM。

enter image description here

接下来,在Anaconda 3命令提示符中以管理模式按此顺序安装以下软件包:

  • Spacy - pip install -U spacy
  • Spacy大型英语语言模型 - python -m spacy download en_core_web_lg
  • 现在链接模型:python -m spacy link en_core_web_lg en
  • 如果上述操作失败,则回退:如果您的网络阻止它,或者下载上述模型的速度太慢,可以通过直接从其GitHub repo下载来回退使用7z提取tar.gz并通过导航到目录来执行python setup.py安装。
  • Scikit - pip install -U scikit-learn
  • Numpy - pip install -U numpy
  • Scipy Package - pip install -U scipy
  • Sklearn - pip install -U sklearn-crfsuite
  • 小鸭 - pip install -U duckling
  • Tensorflow作为一个组成部分 - pip install -U tensorflow
  • 最新版本的RASA NLU - pip install -U rasa_nlu

通过在Anaconda命令提示符中粘贴以下命令来检查是否安装了RASA:

python -c "import rasa_nlu; print(rasa_nlu.__version__);"


2
投票

简答:

使用预编译的轮束以使依赖项无法安装。 (这是一个非官方的来源,所以使用风险)Download here和做

pip install /path/to/bundle.whl

答案很长:

我在安装rasa_nlu时遇到了类似的问题,这就是我解决它的方法。

主要问题是安装Twisted包。我曾尝试安装redistributables和构建工具,我的最终错误看起来像这样 -

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

然后我决定按照here的答案来描述在后备方法中处理python库安装的方法。

我的最终决议是从上面提到的来源下载扭转的轮子,安装包并继续安装rasa。

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

注意:

如果您对使用非官方来源非常怀疑,请按照我之前分享的SF回答中的说明构建您自己的捆绑包并使用该轮进行安装。

© www.soinside.com 2019 - 2024. All rights reserved.