roshan-research / hazm

Persian NLP Toolkit
https://www.roshan-ai.ir/hazm/
MIT License
1.19k stars 180 forks source link

ERROR Incompatible with Python version: 3.11.3 required 3.[9, 10] #295

Closed hiraddlz closed 11 months ago

hiraddlz commented 11 months ago

I will get this error while trying to install the hazm on python 3.11 (due to python-crfsuite installation problem):

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
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\pycrfsuite
      copying pycrfsuite\_dumpparser.py -> build\lib.win-amd64-cpython-311\pycrfsuite
      copying pycrfsuite\_logparser.py -> build\lib.win-amd64-cpython-311\pycrfsuite
      copying pycrfsuite\__init__.py -> build\lib.win-amd64-cpython-311\pycrfsuite
      running build_ext
      building 'pycrfsuite._pycrfsuite' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [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
ERROR: Could not build wheels for python-crfsuite, which is required to install pyproject.toml-based projects

I downgrade to python 3.10 and installed properly.

sir-kokabi commented 11 months ago

سلام. من الان یک venv ساختم و هضم بدون هیچ مشکلی روی پایتون 3.11.3 نصب شد! لطفاً شما هم همین تست رو روی venv مستقلی انجام بدید. نباید مشکلی وجود داشته باشه. تو محیطی که خطا می‌ده سعی کنید یکبار python-crfsuite رو حذف کنید و و آخرین نسخه‌اش یعنی 0.9.9 رو که با پایتون 3.11 سازگار هست نصب بفرمایید.

23236

hiraddlz commented 11 months ago

سلام خیلی ممنون از پاسختون متاسفانه همان خطای قبل را میدهد

https://github.com/roshan-research/hazm/assets/83465357/35efa728-3801-4ccb-ac7a-2111fa8de0f3

sir-kokabi commented 11 months ago

خیلی عجیبه. من احتمال دادم از پایتون 3.11.5 باشه چون من روی 3.11.3 تست گرفته بود ولی روی 3.11.5 هم مشکلی ندیدم. باید فکر کنیم مشکل کجاست. چون از نسخهٔ پایتون و pip نیست. همه چی یکسانه. 23236

imani commented 11 months ago

سلام طبق خطایی که داده احتمالا باید نسخه‌ جدیدتری از microsoft Visual c++ build tools رو نصب کنید: error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

sir-kokabi commented 11 months ago

قبل از نصب C++ Build tools یکبار با conda‌ تست کنید. کاربری اشاره کرده بود که این مشکل رو با virtualenv داشته و با conda مشکل حل شده. همچنین VSCode و powershell رو آپدیت کنید. https://stackoverflow.com/a/73248150/20947581

hiraddlz commented 11 months ago

بله با conda تونستم نصب کنم. خیلی ممنون

MJT369 commented 10 months ago

سلام من کتابخانه parsinorm را نصب کردم مشکل نصب hazm حل شد .