undertheseanlp / underthesea

Underthesea - Vietnamese NLP Toolkit
http://undertheseanlp.com
GNU General Public License v3.0
1.37k stars 270 forks source link

Lỗi cài đặt - MacOS Ventura Version 13.1 #678

Closed mrquangdt closed 1 year ago

mrquangdt commented 1 year ago

Đây là các gói hiện có trong môi trường (miniconda)

# packages in environment at /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24:
#
# Name                    Version                   Build  Channel
appnope                   0.1.3              pyhd8ed1ab_0    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
black                     23.1.0          py311h267d04e_0    conda-forge
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
click                     8.1.3           unix_pyhd8ed1ab_2    conda-forge
comm                      0.1.3              pyhd8ed1ab_0    conda-forge
debugpy                   1.6.6           py311ha397e9f_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
et_xmlfile                1.1.0              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
importlib-metadata        6.1.0              pyha770c72_0    conda-forge
importlib_metadata        6.1.0                hd8ed1ab_0    conda-forge
ipykernel                 6.22.0             pyh736e0ef_0    conda-forge
ipython                   8.11.0             pyhd1c38e8_0    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jupyter_client            8.1.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.0           py311h267d04e_0    conda-forge
libblas                   3.9.0           16_osxarm64_openblas    conda-forge
libcblas                  3.9.0           16_osxarm64_openblas    conda-forge
libcxx                    15.0.7               h75e25f2_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           12_2_0_hd922786_31    conda-forge
libgfortran5              12.2.0              h0eea778_31    conda-forge
liblapack                 3.9.0           16_osxarm64_openblas    conda-forge
libopenblas               0.3.21          openmp_hc731615_3    conda-forge
libsodium                 1.0.18               h27ca646_1    conda-forge
libsqlite                 3.40.0               h76d750c_0    conda-forge
libzlib                   1.2.13               h03a7124_4    conda-forge
llvm-openmp               16.0.0               h7cfbb63_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mypy_extensions           1.0.0              pyha770c72_0    conda-forge
ncurses                   6.3                  h07bb92c_1    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
numpy                     1.24.2          py311h60f8152_0    conda-forge
openpyxl                  3.1.1           py311he2be06e_0    conda-forge
openssl                   3.1.0                h03a7124_0    conda-forge
packaging                 23.0               pyhd8ed1ab_0    conda-forge
pandas                    1.5.3           py311h4eec4a9_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.11.1             pyhd8ed1ab_0    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       23.0.1             pyhd8ed1ab_0    conda-forge
platformdirs              3.1.1              pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
psutil                    5.9.4           py311he2be06e_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.14.0             pyhd8ed1ab_0    conda-forge
python                    3.11.0          h3ba56d0_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.11                    3_cp311    conda-forge
pytz                      2022.7.1           pyhd8ed1ab_0    conda-forge
pyzmq                     25.0.2          py311h0f351f6_0    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
setuptools                67.6.0             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               he1e0b03_0    conda-forge
tokenizers                0.13.2                   pypi_0    pypi
tornado                   6.2             py311he2be06e_1    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.5.0                hd8ed1ab_0    conda-forge
typing_extensions         4.5.0              pyha770c72_0    conda-forge
tzdata                    2022g                h191b570_0    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
zeromq                    4.3.4                hbdafb3b_1    conda-forge
zipp                      3.15.0             pyhd8ed1ab_0    conda-forge

Còn đây là toàn bộ thông báo lỗi

╰─○ pip install underthesea
Collecting underthesea
  Using cached underthesea-6.2.0-py3-none-any.whl (19.2 MB)
Requirement already satisfied: Click>=6.0 in /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/lib/python3.11/site-packages (from underthesea) (8.1.3)
Collecting python-crfsuite>=0.9.6
  Using cached python-crfsuite-0.9.9.tar.gz (440 kB)
  Preparing metadata (setup.py) ... done
Collecting nltk
  Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Collecting tqdm
  Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting requests
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting joblib
  Using cached joblib-1.2.0-py3-none-any.whl (297 kB)
Collecting scikit-learn
  Using cached scikit_learn-1.2.2-cp311-cp311-macosx_12_0_arm64.whl (8.4 MB)
Collecting PyYAML
  Using cached PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl (167 kB)
Collecting underthesea
  Using cached underthesea-6.1.4-py3-none-any.whl (11.1 MB)
  Using cached underthesea-6.1.3-py3-none-any.whl (11.1 MB)
  Using cached underthesea-6.1.2-py3-none-any.whl (11.0 MB)
  Using cached underthesea-6.1.1-py3-none-any.whl (11.0 MB)
  Using cached underthesea-6.1.0-py3-none-any.whl (11.0 MB)
  Using cached underthesea-6.0.3-py3-none-any.whl (11.0 MB)
  Using cached underthesea-6.0.2-py3-none-any.whl (11.0 MB)
  Using cached underthesea-6.0.1-py3-none-any.whl (11.0 MB)
  Using cached underthesea-6.0.0-py3-none-any.whl (11.0 MB)
  Using cached underthesea-1.4.1-py3-none-any.whl (11.0 MB)
  Using cached underthesea-1.4.0-py3-none-any.whl (11.0 MB)
  Using cached underthesea-1.3.5-py3-none-any.whl (11.0 MB)
Collecting unidecode
  Using cached Unidecode-1.3.6-py3-none-any.whl (235 kB)
Collecting underthesea
  Using cached underthesea-1.3.4-py3-none-any.whl (7.6 MB)
  Using cached underthesea-1.3.3-py3-none-any.whl (7.5 MB)
Collecting seqeval
  Using cached seqeval-1.2.2-py3-none-any.whl
Collecting torch>=1.1.0
  Using cached torch-2.0.0-cp311-none-macosx_11_0_arm64.whl (55.8 MB)
Collecting transformers>=3.5.0
  Using cached transformers-4.27.3-py3-none-any.whl (6.8 MB)
Collecting filelock
  Using cached filelock-3.10.4-py3-none-any.whl (10 kB)
Requirement already satisfied: typing-extensions in /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/lib/python3.11/site-packages (from torch>=1.1.0->underthesea) (4.5.0)
Collecting sympy
  Using cached sympy-1.11.1-py3-none-any.whl (6.5 MB)
Collecting networkx
  Using cached networkx-3.0-py3-none-any.whl (2.0 MB)
Collecting jinja2
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting huggingface-hub<1.0,>=0.11.0
  Using cached huggingface_hub-0.13.3-py3-none-any.whl (199 kB)
Requirement already satisfied: numpy>=1.17 in /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/lib/python3.11/site-packages (from transformers>=3.5.0->underthesea) (1.24.2)
Requirement already satisfied: packaging>=20.0 in /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/lib/python3.11/site-packages (from transformers>=3.5.0->underthesea) (23.0)
Collecting regex!=2019.12.17
  Using cached regex-2023.3.23-cp311-cp311-macosx_11_0_arm64.whl (288 kB)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/lib/python3.11/site-packages (from transformers>=3.5.0->underthesea) (0.13.2)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl (121 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting scipy>=1.3.2
  Using cached scipy-1.10.1-cp311-cp311-macosx_12_0_arm64.whl (28.7 MB)
Collecting threadpoolctl>=2.0.0
  Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.2-cp311-cp311-macosx_10_9_universal2.whl (17 kB)
Collecting mpmath>=0.19
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Building wheels for collected packages: python-crfsuite
  Building wheel for python-crfsuite (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-11.0-arm64-cpython-311
      creating build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      copying pycrfsuite/_dumpparser.py -> build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      copying pycrfsuite/_logparser.py -> build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      copying pycrfsuite/__init__.py -> build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      running build_ext
      building 'pycrfsuite._pycrfsuite' extension
      creating build/temp.macosx-11.0-arm64-cpython-311
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/cqdb
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/cqdb/src
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/crf
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/crf/src
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/swig
      creating build/temp.macosx-11.0-arm64-cpython-311/liblbfgs
      creating build/temp.macosx-11.0-arm64-cpython-311/liblbfgs/lib
      creating build/temp.macosx-11.0-arm64-cpython-311/pycrfsuite
      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/include -arch arm64 -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I/opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/include/python3.11 -c crfsuite/lib/cqdb/src/cqdb.c -o build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/cqdb/src/cqdb.o
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-crfsuite
  Running setup.py clean for python-crfsuite
Failed to build python-crfsuite
Installing collected packages: python-crfsuite, mpmath, urllib3, unidecode, tqdm, threadpoolctl, sympy, scipy, regex, PyYAML, networkx, MarkupSafe, joblib, idna, filelock, charset-normalizer, certifi, scikit-learn, requests, nltk, jinja2, torch, seqeval, huggingface-hub, transformers, underthesea
  Running setup.py install for python-crfsuite ... error
  error: subprocess-exited-with-error

  × Running setup.py install for python-crfsuite did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      running install
      /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-11.0-arm64-cpython-311
      creating build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      copying pycrfsuite/_dumpparser.py -> build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      copying pycrfsuite/_logparser.py -> build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      copying pycrfsuite/__init__.py -> build/lib.macosx-11.0-arm64-cpython-311/pycrfsuite
      running build_ext
      building 'pycrfsuite._pycrfsuite' extension
      creating build/temp.macosx-11.0-arm64-cpython-311
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/cqdb
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/cqdb/src
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/crf
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/crf/src
      creating build/temp.macosx-11.0-arm64-cpython-311/crfsuite/swig
      creating build/temp.macosx-11.0-arm64-cpython-311/liblbfgs
      creating build/temp.macosx-11.0-arm64-cpython-311/liblbfgs/lib
      creating build/temp.macosx-11.0-arm64-cpython-311/pycrfsuite
      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/include -arch arm64 -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I/opt/homebrew/Caskroom/miniforge/base/envs/vfs_202303_24/include/python3.11 -c crfsuite/lib/cqdb/src/cqdb.c -o build/temp.macosx-11.0-arm64-cpython-311/crfsuite/lib/cqdb/src/cqdb.o
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> python-crfsuite

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
kidclone3 commented 1 year ago

bạn check xem có phải xcode có vấn đề? thường mỗi lần update xcode là sẽ có 1-2 lỗi lặt vặt phải fix khá đau đầu

AlexBlack2202 commented 1 year ago

Mình bị lỗi này với mac m1

(from underthesea==6.1.1) (3.7) ERROR: Could not find a version that satisfies the requirement underthesea-core==1.0.0 (from underthesea) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4a0, 0.0.4a1, 0.0.4a2, 0.0.4a3, 0.0.4a4, 0.0.4a5, 0.0.4a6, 0.0.4a8) ERROR: No matching distribution found for underthesea-core==1.0.0

Hình như chưa có bản build mới cho mac m1

kidclone3 commented 1 year ago

Screenshot 2023-04-15 at 15 47 22

Mình vẫn cài đặt bình thường, bản mới nhất

AlexBlack2202 commented 1 year ago

Screenshot 2023-04-15 at 15 47 22

Mình vẫn cài đặt bình thường, bản mới nhất

máy bạn bản intel hay m1 vậy bạn

kidclone3 commented 1 year ago

Screenshot 2023-04-15 at 15 47 22 Mình vẫn cài đặt bình thường, bản mới nhất

máy bạn bản intel hay m1 vậy bạn Screenshot 2023-04-15 at 16 54 17

Mình dùng MB Air m1

AlexBlack2202 commented 1 year ago

Screenshot 2023-04-15 at 15 47 22 Mình vẫn cài đặt bình thường, bản mới nhất

máy bạn bản intel hay m1 vậy bạn Screenshot 2023-04-15 at 16 54 17

Mình dùng MB Air m1

à, có vẻ như bạn xài conda thì phải

AlexBlack2202 commented 1 year ago

Mình làm được rồi, cách mình làm như sau

Clone souce underthesea về cd vào thư mục extensions/underthesea_core

chạy lệnh poetry run maturin build --release

sau khi chạy thành công, nó sẽ sinh ra 1 file underthesea_core.whl , đường dẫn của file có ịn lên trên terminal, gọi lệnh pip install file (bao gồm đường dẫn)

vậy là mình cài được underthesea_core bản 1.0.0 rồi, giờ chỉ việc cài unserthesea bản 6.2.0

Mình bị lỗi này với mac m1

(from underthesea==6.1.1) (3.7) ERROR: Could not find a version that satisfies the requirement underthesea-core==1.0.0 (from underthesea) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4a0, 0.0.4a1, 0.0.4a2, 0.0.4a3, 0.0.4a4, 0.0.4a5, 0.0.4a6, 0.0.4a8) ERROR: No matching distribution found for underthesea-core==1.0.0

Hình như chưa có bản build mới cho mac m1