Skip to content

rasa3.0 安装

python 环境搭建

  • python 虚拟环境配置

安装 Miniconda 或者 Anaconda,推荐前者。

https://conda.io/en/latest/miniconda.html

安装完成后设置环境变量:

D:\Users\miniconda3

D:\Users\miniconda3\Scripts

D:\Users\miniconda3\Library\bin

  • 创建 python 虚拟环境
bash
conda create -n py38_rasa python=3.8
  • 激活虚拟环境
bash
conda activate py38_rasa

安装 rasa

rasa-x

2022/6/8 后 rasa-x 不再免费 直接安装 rasa 即可

bash
pip3 install rasa

error

安装 rasa 和 rasa-x 时一直递归:降 pip 版本至 20.2

bash
python -m pip install pip==20.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

依赖库缺失:

有些依赖库需要 Microsoft Visual C++ 14.0 以上的环境 可在 visual studio 中进行安装

或使用 Microsoft C++ Build Tools

https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/

安装速度过慢:

使用国内镜像

bash
pip3 install -i http://mirrors.aliyun.com/pypi/simple/ rasa --trusted-host mirrors.aliyun.com
bash
pip install -i https://pypi.douban.com/simple module # 使用豆瓣源
pip install -i http://mirrors.aliyun.com/pypi/simple/ module # 阿里云
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ module # 中国科技大
pip install -i http://pypi.douban.com/simple/ module # 豆瓣(douban)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ module # 清华大学
pip install -i http://pypi.mirrors.ustc.edu.cn/simple/ module # 中国科学技术大学

fatal

unable to access ‘https://github.com/xxx‘: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connecti-

bash
git config --global --add remote.origin.proxy ""
git config --global http.sslBackend "openssl"

TIP

有部分依赖库安装容易失败,可以提前进行安装:

bash
pip install tensorflow==2.8.4 -i http://mirrors.aliyun.com/pypi/simple/  --trusted-host mirrors.aliyun.com
pip install scikit_learn==1.1.3 -i http://mirrors.aliyun.com/pypi/simple/  --trusted-host mirrors.aliyun.com
pip install matplotlib==3.5.3 -i http://mirrors.aliyun.com/pypi/simple/  --trusted-host mirrors.aliyun.com
pip install protobuf==3.19.6 -i https://pypi.tuna.tsinghua.edu.cn/simple/

初始化 Rasa

bash
rasa init

alt text

error:W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘cublas64_10.dll’; dlerror: cublas64_10.dll not found tensorflow

依赖参考

Rasa Version : 3.3.1
Minimum Compatible Version: 3.0.0
Rasa SDK Version : 3.3.0
Python Version : 3.8.15
requirements.txt
python
absl-py==1.2.0
aio-pika==8.2.5
aiofiles==22.1.0
aiogram==2.19
aiohttp==3.8.3
aioredis==2.0.1
aiormq==6.4.2
aiosignal==1.3.1
alembic==1.4.3
APScheduler==3.9.1.post1
astunparse==1.6.3
async-timeout==4.0.2
attrs==19.3.0
Babel==2.9.1
backports.zoneinfo==0.2.1
bidict==0.22.0
blis==0.7.9
boto3==1.26.13
botocore==1.29.13
CacheControl==0.12.11
cached-property==1.5.2
cachetools==5.2.0
catalogue==2.0.8
certifi @ file:///C:/b/abs_ac29jvt43w/croot/certifi_1665076682579/work/certifi
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
cloudpickle==2.2.0
colorama==0.4.6
colorclass==2.2.2
coloredlogs==15.0.1
colorhash==1.1.0
confection==0.0.3
croniter==1.3.7
cryptography==3.4.8
cycler==0.11.0
cymem==2.0.7
dask==2022.2.0
decorator==4.4.2
Deprecated==1.2.13
dnspython==1.16.0
docopt==0.6.2
fbmessenger==6.0.0
fire==0.4.0
flatbuffers==22.10.26
fonttools==4.38.0
frozenlist==1.3.3
fsspec==2022.11.0
future==0.18.2
gast==0.5.3
gitdb==4.0.9
GitPython==3.1.29
google-auth==2.14.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
greenlet==2.0.1
grpcio==1.50.0
h5py==3.7.0
httptools==0.5.0
humanfriendly==10.0
idna==3.4
importlib-metadata==5.0.0
isodate==0.6.1
jieba==0.42.1
Jinja2==3.1.2
jmespath==1.0.1
joblib==1.2.0
jsonpickle==2.0.0
jsonschema==3.2.0
kafka-python==2.0.2
keras==2.8.0
Keras-Preprocessing==1.1.2
kiwisolver==1.4.4
langcodes==3.3.0
libclang==14.0.6
locket==1.0.0
lxml==4.7.0
Mako==1.2.4
Markdown==3.4.1
MarkupSafe==2.1.1
matplotlib==3.5.3
mattermostwrapper==2.2
mitie @ git+https://github.com/mit-nlp/MITIE.git@42dbcd5dad55e9d5bc76580fc9582097342d9916
msgpack==1.0.4
multidict==5.2.0
murmurhash==1.0.9
networkx==2.5.1
numpy==1.23.5
oauthlib==3.2.2
opt-einsum==3.3.0
packaging==20.9
pamqp==3.2.1
partd==1.3.0
passlib==1.7.4
pathy==0.10.0
pika==1.3.1
Pillow==9.3.0
pluggy==1.0.0
preshed==3.0.8
prompt-toolkit==3.0.28
protobuf==3.19.6
psycopg2-binary==2.9.5
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pydantic==1.10.2
pydot==1.4.2
PyJWT==2.1.0
pykwalify==1.8.0
pymongo==3.10.1
pyparsing==3.0.9
pyreadline3==3.4.1
pyrsistent==0.19.2
python-crfsuite==0.9.8
python-dateutil==2.8.2
python-editor==1.0.4
python-engineio==4.3.4
python-socketio==5.7.2
python3-saml==1.14.0
pytz==2022.6
pytz-deprecation-shim==0.1.0.post0
PyYAML==6.0
questionary==1.5.2
randomname==0.1.5
rasa==3.3.1
rasa-sdk==3.3.0
rasa-x==1.1.4
redis==4.3.4
regex==2022.9.13
requests==2.28.1
requests-oauthlib==1.3.1
requests-toolbelt==0.10.1
rocketchat-API==1.26.0
rsa==4.9
ruamel.yaml==0.16.13
ruamel.yaml.clib==0.2.7
s3transfer==0.6.0
sanic==21.12.2
Sanic-Cors==2.0.1
sanic-jwt==1.7.0
sanic-routing==0.7.2
scikit-learn==1.1.3
scipy==1.8.1
sentry-sdk==1.3.1
six==1.16.0
sklearn-crfsuite==0.3.6
slackclient==2.9.4
smart-open==5.2.1
smmap==5.0.0
spacy==3.4.3
spacy-legacy==3.0.10
spacy-loggers==1.0.3
SQLAlchemy==1.4.44
srsly==2.4.5
tabulate==0.9.0
tarsafe==0.0.3
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.8.4
tensorflow-addons==0.17.1
tensorflow-estimator==2.8.0
tensorflow-hub==0.12.0
tensorflow-io-gcs-filesystem==0.27.0
termcolor==2.1.1
terminaltables==3.1.10
thinc==8.1.5
threadpoolctl==3.1.0
toolz==0.12.0
tqdm==4.64.1
twilio==7.14.2
typeguard==2.13.3
typer==0.7.0
typing-extensions==3.10.0.2
typing-utils==0.1.0
tzdata==2022.6
tzlocal==4.2
ujson==1.35
urllib3==1.26.12
wasabi==0.10.1
wcwidth==0.2.5
webexteamssdk==1.6.1
websockets==10.4
Werkzeug==2.2.2
wincertstore==0.2
wrapt==1.14.1
xmlsec==1.3.13
yarg==0.1.9
yarl==1.8.1
zipp==3.10.0

RasaX

如果实在想使用 rasa-x 可视化界面,可以使用以下版本进行安装:

Rasa Version : 2.7.1
Minimum Compatible Version: 2.6.0
Rasa SDK Version : 2.7.0
Rasa X Version : 0.39.3
Python Version : 3.8.15
requirements.txt
python
absl-py==0.12.0
aio-pika==6.8.2
aiofiles==22.1.0
aiohttp==3.7.4
aiormq==3.3.1
alembic==1.4.3
APScheduler==3.7.0
astunparse==1.6.3
async-generator==1.10
async-timeout==3.0.1
attrs==19.3.0
bidict==0.22.0
blis==0.7.9
boto3==1.26.15
botocore==1.29.15
cachetools==5.2.0
catalogue==2.0.8
certifi @ file:///C:/b/abs_ac29jvt43w/croot/certifi_1665076682579/work/certifi
cffi==1.15.1
chardet==3.0.4
charset-normalizer==2.1.1
click==8.1.3
cloudpickle==1.6.0
colorama==0.4.6
colorclass==2.2.2
coloredlogs==15.0.1
colorhash==1.0.4
confection==0.0.3
croniter==1.3.8
cryptography==3.4.8
cycler==0.11.0
cymem==2.0.7
decorator==4.4.2
dm-tree==0.1.7
dnspython==1.16.0
docopt==0.6.2
fbmessenger==6.0.0
future==0.18.2
gast==0.5.3
gitdb==4.0.9
GitPython==3.1.29
google-auth==2.14.1
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.50.0
h11==0.9.0
h5py==2.10.0
httpcore==0.11.1
httplib2==0.21.0
httptools==0.5.0
httpx==0.15.4
humanfriendly==10.0
idna==2.10
importlib-metadata==5.0.0
isodate==0.6.1
jieba==0.42.1
Jinja2==3.1.2
jmespath==1.0.1
joblib==1.0.1
jsonpickle==2.0.0
jsonschema==3.2.0
kafka-python==1.4.7
Keras-Preprocessing==1.1.2
kiwisolver==1.4.4
langcodes==3.3.0
Mako==1.2.4
Markdown==3.4.1
MarkupSafe==2.1.1
matplotlib==3.3.4
mattermostwrapper==2.2
mitie @ git+https://github.com/mit-nlp/MITIE.git@42dbcd5dad55e9d5bc76580fc9582097342d9916
multidict==4.7.6
murmurhash==1.0.9
networkx==2.5.1
numpy==1.18.5
oauth2client==4.1.3
oauthlib==3.2.2
opt-einsum==3.3.0
packaging==20.9
pamqp==2.3.0
pathy==0.10.0
pika==1.3.1
Pillow==9.3.0
preshed==3.0.8
prompt-toolkit==2.0.10
protobuf==3.20.0
psycopg2-binary==2.8.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pydantic==1.10.2
pydot==1.4.2
PyJWT==2.0.0
pykwalify==1.8.0
pymongo==3.10.1
pyparsing==3.0.9
pyreadline3==3.4.1
pyrsistent==0.19.2
pyTelegramBotAPI==3.8.3
python-crfsuite==0.9.8
python-dateutil==2.8.2
python-editor==1.0.4
python-engineio==4.3.4
python-socketio==5.7.2
pytz==2021.3
PyYAML==6.0
questionary==1.5.2
rasa==2.7.1
rasa-sdk==2.7.0
rasa-x==0.39.3
redis==3.5.3
regex==2020.9.27
requests==2.25.1
requests-oauthlib==1.3.1
requests-toolbelt==0.10.1
rfc3986==1.5.0
rocketchat-API==1.15.0
rsa==4.9
ruamel.yaml==0.16.13
ruamel.yaml.clib==0.2.7
s3transfer==0.6.0
sanic==20.9.0
Sanic-Cors==0.10.0.post3
sanic-jwt==1.6.0
Sanic-Plugins-Framework==0.9.5
scikit-learn==0.24.2
scipy==1.9.3
sentry-sdk==1.1.0
six==1.16.0
sklearn-crfsuite==0.3.6
slackclient==2.9.4
smart-open==5.2.1
smmap==5.0.0
sniffio==1.3.0
spacy==3.4.3
spacy-legacy==3.0.10
spacy-loggers==1.0.3
SQLAlchemy==1.3.22
srsly==2.4.5
tabulate==0.9.0
tensorboard==2.11.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.3.4
tensorflow-addons==0.12.1
tensorflow-estimator==2.3.0
tensorflow-hub==0.10.0
tensorflow-probability==0.11.1
termcolor==2.1.1
terminaltables==3.1.10
thinc==8.1.5
threadpoolctl==3.1.0
tqdm==4.59.0
twilio==6.50.1
typeguard==2.13.3
typer==0.7.0
typing-extensions==3.10.0.2
tzlocal==2.1
ujson==1.35
urllib3==1.26.12
wasabi==0.10.1
wcwidth==0.2.5
webexteamssdk==1.6.1
websockets==8.1
Werkzeug==2.2.2
wincertstore==0.2
wrapt==1.14.1
yarl==1.8.1
zipp==3.10.0

error

AttributeError: ‘Sanic’ object has no attribute ‘auth’

bash
pip uninstall sanic-jwt
pip install sanic-jwt==1.6.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/

error

ImportError: cannot import name ‘RowProxy’ from ‘sqlalchemy.engine’ Install

bash
pip install SQLAlchemy==1.3.22

eRuntimeError:Event loop is closed

可以忽略,如果实在不想看见,在报错的位置注释掉异常抛出:

alt text 我这里的文件是 c:\programdata\miniconda3\envs\py38_rasax\lib\asyncio\base_events.py