在Windows上安装rasa

2024-05-19 09:47:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在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可再发行软件、安装构建工具等,但都没有成功。


Tags: installpipincludewindows错误errorfilesprogram
3条回答

简短回答:

对于无法安装的依赖项,请使用预编译的wheel bundle。(这是一个非官方的消息来源,因此请自行承担风险)Download here然后

pip install /path/to/bundle.whl

长答案

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

主要问题是安装扭曲的软件包。我试过安装可再发行软件和构建工具,最后的错误是这样的-

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库安装的方法。

我的最终解决方案是从上面提到的源下载twisted wheel,安装包并继续安装rasa。

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

注意:

如果您对使用非官方源代码持怀疑态度,请按照我之前共享的SF answer中的说明来构建您自己的包并使用该轮子进行安装。

到目前为止,为了让rasa(和tensorflow)在您的windows机器上工作:

您需要将python版本至少降低到python 3.6 您需要将python dateutil的值至少降低到2.8.0 步骤假设已经安装了PIP、Virtualenv,则必须执行以下步骤:

Python旧版本:为了安装它,请下载Python的旧版本(我找到了一个here

使用刚刚安装的python版本创建一个虚拟env。使用命令mkvirtualenv--python=path_of_python_older_version\name_of_env

激活你刚刚创建的环境(工作名称)

现在使用命令pip install python dateutil==2.8.0安装较旧版本的python dateutil

现在可以使用命令pip install rasa安装rasa

希望有帮助

我也面临同样的问题。我是这样解决的:

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

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

enter image description here

同时安装JDKJRE并将JAVA_HOME环境变量设置为RASA NLU所需的Duckling Date解析器需要JVM

enter image description here

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

  • Spacypip install -U spacy
  • Spacy Large English language model - python -m spacy download en_core_web_lg
  • Link the model now: python -m spacy link en_core_web_lg en

  • Fallback if the above fails: If your network is blocking it, or is too slow to download the above model, fallback by downloading it directly from its GitHub repo extract the tar.gz using 7z and do python setup.py install by navigating into the directory.

  • Scikitpip install -U scikit-learn

  • Numpypip install -U numpy
  • Scipy Packagepip install -U scipy
  • Sklearnpip install -U sklearn-crfsuite
  • Ducklingpip install -U duckling
  • Tensorflow as a component - pip install -U tensorflow
  • Latest version of RASA NLUpip install -U rasa_nlu

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

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

相关问题 更多 >

    热门问题