简体   繁体   English

无法安装 pystruct

[英]Cannot install pystruct

I am trying to install pystruct in a Google colab notebook.我正在尝试在 Google colab 笔记本中安装pystruct I ran the command !pip install pystruct but it gave me the following error:我运行了命令!pip install pystruct但它给了我以下错误:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting pystruct
  Using cached pystruct-0.3.2.tar.gz (5.6 MB)
Requirement already satisfied: ad3 in /usr/local/lib/python3.7/dist-packages (from pystruct) (2.2.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from pystruct) (1.21.6)
Building wheels for collected packages: pystruct
  Building wheel for pystruct (setup.py) ... error
  ERROR: Failed building wheel for pystruct
  Running setup.py clean for pystruct
Failed to build pystruct
Installing collected packages: pystruct
    Running setup.py install for pystruct ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-02lv77ji/pystruct_dc17de7a2ad6430496ef5c82985a0a60/setup.py'"'"'; __file__='"'"'/tmp/pip-install-02lv77ji/pystruct_dc17de7a2ad6430496ef5c82985a0a60/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tw042u_g/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/pystruct Check the logs for full command output.

Can someone please help me install it or suggest an alternate library for CRF in python.有人可以帮我安装它或为python中的CRF建议一个备用库。

Use these commands to install pystruct使用这些命令安装 pystruct

git clone https://github.com/pystruct/pystruct && cd pystruct
curl https://patch-diff.githubusercontent.com/raw/pystruct/pystruct/pull/221.patch | git apply
pip install .

credit: https://github.com/pystruct/pystruct/issues/237#issuecomment-661648379信用: https ://github.com/pystruct/pystruct/issues/237#issuecomment-661648379

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM