Rasa NLU安装问题

时间:2018-05-19 04:58:54

标签: chatbot rasa-nlu

我安装了rasa nlu版本0.12.3。我有一些问题,并使用

卸载了rasa nlu和其他要求
pip uninstall rasa_nlu
pip uninstall -r requirements.txt

现在,当我使用pip install rasa_nlu

再次安装rasa nlu时

我在终端

中看到以下消息
Error processing line 1 of /Users/uername/anaconda3/lib/python3.6/site-packages/matplotlib-2.0.2-py3.6-nspkg.pth:



     Traceback (most recent call last):
        File "/Users/username/anaconda3/lib/python3.6/site.py", line 168, in addpackage
          exec(line)
        File "<string>", line 1, in <module>
        File "<frozen importlib._bootstrap>", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored

There are more messages regarding installation and the final message is

    Found existing installation: greenlet 0.4.12
    Cannot uninstall 'greenlet'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

事实证明没有安装rasa nlu。我知道nlu没有安装,因为我用以下命令检查nlu版本

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

我收到错误

Error processing line 1 of /Users/username/anaconda3/lib/python3.6/site-packages/matplotlib-2.0.2-py3.6-nspkg.pth:



    Traceback (most recent call last):
        File "/Users/username/anaconda3/lib/python3.6/site.py", line 168, in addpackage
          exec(line)
        File "<string>", line 1, in <module>
        File "<frozen importlib._bootstrap>", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'rasa_nlu'

4 个答案:

答案 0 :(得分:1)

事实证明,由于安装了distutils项目而导致问题发生,pip install在安装前无法卸载。

所以我不得不使用--ignore-installed

简而言之,下面的命令解决了问题

sudo pip install --ignore-installed rasa_nlu 

答案 1 :(得分:0)

如果要卸载distutils的python软件包,则可以从“ site-packages”文件夹中手动删除该文件夹。如果是Anaconda发行版,它将在以下文件夹中。我建议剪切文件夹并将其粘贴到其他位置以进行备份。

在Windows中:

C:\ Users \\ AppData \ Local \ Continuum \ Anaconda3 \ Lib \ site-packages

我确定Linux将具有类似的文件夹结构。

以下两项需要删除。

文件夹[软件包版本号] 文件-[package> .egg-info]

答案 2 :(得分:0)

如Rasa的官方文档中所述,请使用

进行安装
<mat-grid-list cols="3" rowHeight="2:1">
  <mat-grid-tile colspan="2">
    <div class="w-100">


    </div>
  </mat-grid-tile>

  <mat-grid-tile>
    <div class="w-100">


    </div>
  </mat-grid-tile>
</mat-grid-list>

它将安装Rasa X和Rasa。效果很好。

答案 3 :(得分:0)

pip3 install rasa-x -U --extra-index-url https://pypi.rasa.com/simple

installation guide