0

我按照以下步骤安装 ELMoForManyLangs

! git clone https://github.com/HIT-SCIR/ELMoForManyLangs.git

cd ELMoForManyLangs/

! python setup.py install

from elmoformanylangs import Embedder

ModuleNotFoundError Traceback(最近一次调用最后一次)

在 ()

----> 1 from elmoformanylangs import Embedder

2 # e = Embedder('./zhs.model/')

但我确实成功部署了它。

    运行安装
    运行 bdist_egg
    运行 egg_info
    创建 elmoformanylangs.egg-info
    写 elmoformanylangs.egg-info/PKG-INFO
    将dependency_links写入elmoformanylangs.egg-info/dependency_links.txt
    将要求写入 elmoformanylangs.egg-info/requires.txt
    将顶级名称写入 elmoformanylangs.egg-info/top_level.txt
    编写清单文件'elmoformanylangs.egg-info/SOURCES.txt'
    编写清单文件'elmoformanylangs.egg-info/SOURCES.txt'
    将库代码安装到 build/bdist.linux-x86_64/egg
    运行 install_lib
    运行 build_py
    创建构建
    创建构建/库
    创建 build/lib/elmoformanylangs
    复制 elmoformanylangs/biLM.py -> build/lib/elmoformanylangs
    复制 elmoformanylangs/__init__.py -> build/lib/elmoformanylangs
    复制 elmoformanylangs/__main__.py -> build/lib/elmoformanylangs
    复制 elmoformanylangs/utils.py -> build/lib/elmoformanylangs
    复制 elmoformanylangs/elmo.py -> build/lib/elmoformanylangs
    复制 elmoformanylangs/dataloader.py -> build/lib/elmoformanylangs
    复制 elmoformanylangs/frontend.py -> build/lib/elmoformanylangs
    创建 build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/lstm_cell_with_projection.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/encoder_base.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/embedding_layer.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/lstm.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/__init__.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/util.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/classify_layer.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/token_embedder.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/elmo.py -> build/lib/elmoformanylangs/modules
    复制 elmoformanylangs/modules/highway.py -> build/lib/elmoformanylangs/modules
    创建 build/bdist.linux-x86_64
    创建 build/bdist.linux-x86_64/egg
    创建 build/bdist.linux-x86_64/egg/elmoformanylangs
    复制 build/lib/elmoformanylangs/biLM.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    复制 build/lib/elmoformanylangs/__init__.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    复制 build/lib/elmoformanylangs/__main__.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    复制 build/lib/elmoformanylangs/utils.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    复制 build/lib/elmoformanylangs/elmo.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    创建 build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/lstm_cell_with_projection.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/encoder_base.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/embedding_layer.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/lstm.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/__init__.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/util.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/classify_layer.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/token_embedder.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/elmo.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/modules/highway.py -> build/bdist.linux-x86_64/egg/elmoformanylangs/modules
    复制 build/lib/elmoformanylangs/dataloader.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    复制 build/lib/elmoformanylangs/frontend.py -> build/bdist.linux-x86_64/egg/elmoformanylangs
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/biLM.py 到 biLM.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/__init__.py 到 __init__.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/__main__.py 到 __main__.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/utils.py 到 utils.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/elmo.py 到 elmo.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/lstm_cell_with_projection.py 到 lstm_cell_with_projection.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/encoder_base.py 到 encoder_base.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/embedding_layer.py 到 embedding_layer.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/lstm.py 到 lstm.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/__init__.py 到 __init__.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/util.py 到 util.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/classify_layer.py 到分类层.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/token_embedder.py 到 token_embedder.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/elmo.py 到 elmo.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/modules/highway.py 到 Highway.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/dataloader.py 到 dataloader.cpython-36.pyc
    字节编译 build/bdist.linux-x86_64/egg/elmoformanylangs/frontend.py 到 frontend.cpython-36.pyc
    创建 build/bdist.linux-x86_64/egg/EGG-INFO
    复制 elmoformanylangs.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
    复制 elmoformanylangs.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    复制 elmoformanylangs.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    复制 elmoformanylangs.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    复制 elmoformanylangs.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    未设置 zip_safe 标志;分析存档内容...
    创建区域
    创建'dist/elmoformanylangs-0.0.2-py3.6.egg'并添加'build/bdist.linux-x86_64/egg'
    删除“build/bdist.linux-x86_64/egg”(以及它下面的所有内容)
    处理 elmoformanylangs-0.0.2-py3.6.egg
    将 elmoformanylangs-0.0.2-py3.6.egg 复制到 /usr/local/lib/python3.6/dist-packages
    将 elmoformanylangs 0.0.2 添加到 easy-install.pth 文件

    安装 /usr/local/lib/python3.6/dist-packages/elmoformanylangs-0.0.2-py3.6.egg
    elmoformanylangs==0.0.2 的处理依赖项
    搜索覆盖
    阅读 https://pypi.org/simple/overrides/
    Downloading https://files.pythonhosted.org/packages/7a/b2/2cb6a3fc8ee1dc8617e07e476be19723748ddfcce0c6b9db7a5f2d5b9598/overrides-2.0.tar.gz#sha256=63293d9b03629507396ddd961bd5773f136d602f34b9b3da93351dfa163fc0d9
    最佳匹配:覆盖 2.0
    处理 overrides-2.0.tar.gz
    编写 /tmp/easy_install-_c47zox2/overrides-2.0/setup.cfg
    运行 overrides-2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_c47zox2/overrides-2.0/egg-dist-tmp-677wh9fn
    未设置 zip_safe 标志;分析存档内容...
    将 overrides-2.0-py3.6.egg 移动到 /usr/local/lib/python3.6/dist-packages
    将覆盖 2.0 添加到 easy-install.pth 文件

    安装 /usr/local/lib/python3.6/dist-packages/overrides-2.0-py3.6.egg
    搜索 numpy==1.17.2
    最佳匹配:numpy 1.17.2
    将 numpy 1.17.2 添加到 easy-install.pth 文件
    将 f2py 脚本安装到 /usr/local/bin
    将 f2py3 脚本安装到 /usr/local/bin
    将 f2py3.6 脚本安装到 /usr/local/bin

    使用 /tensorflow-2.0.0-rc2/python3.6
    搜索 h5py==2.10.0
    最佳匹配:h5py 2.10.0
    将 h5py 2.10.0 添加到 easy-install.pth 文件

    使用 /tensorflow-2.0.0-rc2/python3.6
    搜索火炬==1.2.0
    最佳匹配:火炬 1.2.0
    将 torch 1.2.0 添加到 easy-install.pth 文件
    将 convert-caffe2-to-onnx 脚本安装到 /usr/local/bin
    将 convert-onnx-to-caffe2 脚本安装到 /usr/local/bin

    使用 /usr/local/lib/python3.6/dist-packages
    搜索六==1.12.0
    最佳匹配:6 1.12.0
    将六个 1.12.0 添加到 easy-install.pth 文件

    使用 /usr/local/lib/python3.6/dist-packages
    elmoformanylangs==0.0.2 的完成处理依赖项

4

1 回答 1

-2

里面的路径e = Embedder('./zhs.model/')是绝对路径,不是相对路径。例如'/content/drive/Colab Notebooks/../zhs.model/'

于 2020-03-13T02:12:26.223 回答