opennmt安装踩坑记录

两种安装方式:
1、pip install
这种安装方式装的opennmt是1.2.0版本,会导致onmt_build_vocab等命令无法识别。
解决方法:

pip install --upgrade OpenNMT-py==2.0.0rc1

2、build

git clone https://github.com/OpenNMT/OpenNMT-py.git
cd OpenNMT-py
python setup.py install

这种方式中会出现的错误opennmt-py 2.0.0rc2 has requirement pyyaml==5.3.1, but you'll have pyyaml 3.13 which is incompatible.
pip之后依然会:Cannot uninstall 'PyYAML'. 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.
解决方案:

pip install --ignore-installed PyYAML==5.3.1

你可能感兴趣的:(opennmt安装踩坑记录)