Open skulltie opened 8 months ago
bạn thử dùng pip3 thử xem, mình đổi thì nó install thành công:
pip3 install underthesea
bạn thử pip install maturin
trước xem sao. mình mới pip install underthesea
thì vẫn ok, mặc dù mình chưa cài maturin
trước đó
Mình cũng gặp vấn đề này với python >=3.12 , vào check Pypi thì thấy Underthesea chỉ có whl (prebuilt) cho python <=3.11 thôi. Nên cài cho 3.12 gặp vấn đề khi build whl local sử dụng maturin.
Mình downgrade về python 3.11 thì cài ok.
@RyanDam, thank you for your investigation. Please follow issue #729. I will support Python 3.12 later.
@rain1024 same problem here, waiting for new update to support underthesea in python3.12
Mình vẫn gặp lỗi này trên Linux (arm64). Mình đã thử trên cả Python3.10 và 3.11 và đều bị lỗi tương tự. Có cách nào khác phục không các bạn.
Cảm ơn vì thời gian và đóng góp của các bạn.
(.env2) tts@74c54ea31fd9:/var/tts-demo/vixtts-demo$ pip install underthesea
Collecting underthesea
Downloading underthesea-6.8.4-py3-none-any.whl.metadata (15 kB)
Collecting Click>=6.0 (from underthesea)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting python-crfsuite>=0.9.6 (from underthesea)
Using cached python-crfsuite-0.9.10.tar.gz (478 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting nltk (from underthesea)
Using cached nltk-3.9.1-py3-none-any.whl.metadata (2.9 kB)
Collecting tqdm (from underthesea)
Using cached tqdm-4.66.5-py3-none-any.whl.metadata (57 kB)
Collecting requests (from underthesea)
Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting joblib (from underthesea)
Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
Collecting scikit-learn (from underthesea)
Using cached scikit_learn-1.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (13 kB)
Collecting PyYAML (from underthesea)
Using cached PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (2.1 kB)
Collecting underthesea-core==1.0.4 (from underthesea)
Using cached underthesea_core-1.0.4.tar.gz (560 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
status = _inner_run()
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
return self.run(options, args)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 379, in run
requirement_set = resolver.resolve(
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 230, in _get_updated_criteria
self._add_to_criteria(criteria, requirement, parent=candidate)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in bool
return bool(self._sequence)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 174, in bool
return any(self)
File "/var/tts-demo/vixtts-demo/.env2/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in
Same problem here, and installing maturin
and compile underthesea-core
manually does not work:
Updating crates.io index
Locking 96 packages to latest compatible versions
Adding bitflags v1.3.2 (latest: v2.6.0)
Adding bstr v0.2.17 (latest: v1.10.0)
Adding clap v2.34.0 (latest: v4.5.18)
Adding crfs v0.1.3 (latest: v0.2.0)
Adding criterion v0.3.6 (latest: v0.5.1)
Adding criterion-plot v0.4.5 (latest: v0.5.0)
Adding half v1.8.3 (latest: v2.4.1)
Adding hermit-abi v0.1.19 (latest: v0.4.0)
Adding indoc v0.3.6 (latest: v2.0.5)
Adding indoc-impl v0.3.6 (latest: v0.3.7)
Adding itertools v0.10.5 (latest: v0.13.0)
Adding parking_lot v0.11.2 (latest: v0.12.3)
Adding parking_lot_core v0.8.6 (latest: v0.9.10)
Adding paste v0.1.18 (latest: v1.0.15)
Adding pyo3 v0.15.2 (latest: v0.22.3)
Adding pyo3-build-config v0.15.2 (latest: v0.22.3)
Adding pyo3-macros v0.15.2 (latest: v0.22.3)
Adding pyo3-macros-backend v0.15.2 (latest: v0.22.3)
Adding redox_syscall v0.2.16 (latest: v0.5.6)
Adding regex-automata v0.1.10 (latest: v0.4.7)
Adding syn v1.0.109 (latest: v2.0.77)
Adding textwrap v0.11.0 (latest: v0.16.1)
Adding unicode-width v0.1.14 (latest: v0.2.0)
Adding unindent v0.1.11 (latest: v0.2.3)
Downloaded lazy_static v1.5.0
Downloaded itoa v1.0.11
Downloaded log v0.4.22
Downloaded array-init v2.1.0
Downloaded lock_api v0.4.12
Downloaded cfg-if v1.0.0
Downloaded cast v0.3.0
Downloaded bitflags v1.3.2
Downloaded itertools v0.10.5
Downloaded oorandom v11.1.4
Downloaded plotters-svg v0.3.7
Downloaded bstr v1.10.0
Downloaded paste-impl v0.1.18
Downloaded pyo3-macros-backend v0.15.2
Downloaded crossbeam-utils v0.8.20
Downloaded either v1.13.0
Downloaded crossbeam-epoch v0.9.18
Downloaded crossbeam-deque v0.8.5
Downloaded criterion v0.3.6
Downloaded clap v2.34.0
Downloaded once_cell v1.19.0
Downloaded memchr v2.7.4
Downloaded quote v1.0.37
Downloaded proc-macro2 v1.0.86
Downloaded autocfg v1.4.0
Downloaded same-file v1.0.6
Downloaded wasm-bindgen-shared v0.2.93
Downloaded tinytemplate v1.2.1
Downloaded serde_derive v1.0.210
Downloaded wasm-bindgen-macro-support v0.2.93
Downloaded unicode-ident v1.0.13
Downloaded rayon v1.10.0
Downloaded wasm-bindgen v0.2.93
Downloaded plotters v0.3.7
Downloaded serde_json v1.0.128
Downloaded unindent v0.1.11
Downloaded winapi-util v0.1.9
Downloaded textwrap v0.11.0
Downloaded windows-targets v0.52.6
Downloaded serde_cbor v0.11.2
Downloaded redox_syscall v0.2.16
Downloaded wasm-bindgen-backend v0.2.93
Downloaded serde v1.0.210
Downloaded wasm-bindgen-macro v0.2.93
Downloaded plotters-backend v0.3.7
Downloaded num-traits v0.2.19
Downloaded aho-corasick v1.1.3
Downloaded criterion-plot v0.4.5
Downloaded bumpalo v3.16.0
Downloaded pyo3-macros v0.15.2
Downloaded pyo3-build-config v0.15.2
Downloaded scopeguard v1.2.0
Downloaded walkdir v2.5.0
Downloaded smallvec v1.13.2
Downloaded regex-automata v0.1.10
Downloaded ryu v1.0.18
Downloaded regex v1.10.6
Downloaded rayon-core v1.12.1
Downloaded bstr v0.2.17
Downloaded parking_lot_core v0.8.6
Downloaded proc-macro-hack v0.5.20+deprecated
Downloaded instant v0.1.13
Downloaded csv-core v0.1.11
Downloaded syn v1.0.109
Downloaded paste v0.1.18
Downloaded parking_lot v0.11.2
Downloaded js-sys v0.3.70
Downloaded indoc-impl v0.3.6
Downloaded pyo3 v0.15.2
Downloaded regex-syntax v0.8.4
Downloaded syn v2.0.77
Downloaded unicode-width v0.1.14
Downloaded indoc v0.3.6
Downloaded hermit-abi v0.1.19
Downloaded half v1.8.3
Downloaded atty v0.2.14
Downloaded libc v0.2.159
Downloaded windows_aarch64_gnullvm v0.52.6
Downloaded windows_i686_gnullvm v0.52.6
Downloaded windows_x86_64_gnullvm v0.52.6
Downloaded regex-automata v0.4.7
Downloaded web-sys v0.3.70
Downloaded windows_i686_gnu v0.52.6
Downloaded winapi v0.3.9
Downloaded jhash v0.1.1
Downloaded windows_aarch64_msvc v0.52.6
Downloaded windows_x86_64_gnu v0.52.6
Downloaded windows_x86_64_msvc v0.52.6
Downloaded windows_i686_msvc v0.52.6
Downloaded crfs v0.1.3
Downloaded cqdb v0.5.8
Downloaded csv v1.3.0
Downloaded windows-sys v0.59.0
Downloaded winapi-i686-pc-windows-gnu v0.4.0
Downloaded winapi-x86_64-pc-windows-gnu v0.4.0
Downloaded 95 crates (23.3 MB) in 4.27s (largest was `winapi-x86_64-pc-windows-gnu` at 2.9 MB)
🔗 Found pyo3 bindings
🐍 Found CPython 3.12 at /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
💻 Using `MACOSX_DEPLOYMENT_TARGET=10.12` for x86_64-apple-darwin by default
Compiling proc-macro2 v1.0.86
Compiling unicode-ident v1.0.13
Compiling proc-macro-hack v0.5.20+deprecated
Compiling memchr v2.7.4
Compiling quote v1.0.37
Compiling pyo3-build-config v0.15.2
Compiling syn v1.0.109
Compiling once_cell v1.19.0
Compiling crossbeam-utils v0.8.20
Compiling autocfg v1.4.0
Compiling libc v0.2.159
Compiling lock_api v0.4.12
Compiling cfg-if v1.0.0
Compiling parking_lot_core v0.8.6
Compiling instant v0.1.13
Compiling crossbeam-epoch v0.9.18
Compiling smallvec v1.13.2
Compiling unindent v0.1.11
Compiling scopeguard v1.2.0
Compiling rayon-core v1.12.1
Compiling pyo3-macros-backend v0.15.2
Compiling indoc-impl v0.3.6
Compiling crossbeam-deque v0.8.5
Compiling pyo3 v0.15.2
Compiling paste-impl v0.1.18
Compiling syn v2.0.77
Compiling aho-corasick v1.1.3
Compiling bstr v1.10.0
Compiling jhash v0.1.1
Compiling array-init v2.1.0
Compiling serde v1.0.210
Compiling bitflags v1.3.2
Compiling regex-automata v0.1.10
Compiling lazy_static v1.5.0
Compiling regex-syntax v0.8.4
Compiling bstr v0.2.17
Compiling cqdb v0.5.8
Compiling serde_derive v1.0.210
Compiling regex-automata v0.4.7
Compiling paste v0.1.18
Compiling pyo3-macros v0.15.2
Compiling parking_lot v0.11.2
Compiling indoc v0.3.6
Compiling either v1.13.0
Compiling rayon v1.10.0
Compiling regex v1.10.6
error[E0425]: cannot find function, tuple struct or tuple variant `PyUnicode_READY` in module `ffi`
--> /Users/blkserene/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.15.2/src/types/string.rs:232:30
|
232 | let ready = ffi::PyUnicode_READY(ptr);
| ^^^^^^^^^^^^^^^ help: a function with a similar name exists: `PyUnicode_IS_READY`
|
::: /Users/blkserene/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.15.2/src/ffi/cpython/unicodeobject.rs:224:1
|
224 | pub unsafe fn PyUnicode_IS_READY(op: *mut PyObject) -> c_uint {
| ------------------------------------------------------------- similarly named function `PyUnicode_IS_READY` defined here
For more information about this error, try `rustc --explain E0425`.
error: could not compile `pyo3` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit status: 101": `env -u CARGO MACOSX_DEPLOYMENT_TARGET="10.12" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.12-64bit" PYO3_PYTHON="/Library/Frameworks/Python.framework/Versions/3.12/bin/python3" PYTHON_SYS_EXECUTABLE="/Library/Frameworks/Python.framework/Versions/3.12/bin/python3" "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/Users/blkserene/Desktop/underthesea_core-1.0.4/Cargo.toml" "--lib" "--crate-type" "cdylib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/underthesea_core.cpython-312-darwin.so"`
Mình tải thử cả bằng win 10 và mac nhưng đều hiện 1 lỗi như sau ERROR: Exception: Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\cli\base_command.py", line 180, in exc_logging_wrapper status = run_func(*args) ^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\cli\req_command.py", line 245, in wrapper return func(self, options, args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\commands\install.py", line 377, in run requirement_set = resolver.resolve( ^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 95, in resolve result = self._result = resolver.resolve( ^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 546, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 427, in resolve failure_causes = self._attempt_to_pin_criterion(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 239, in _attempt_to_pin_criterion criteria = self._get_updated_criteria(candidate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 230, in _get_updated_criteria self._add_to_criteria(criteria, requirement, parent=candidate) File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria if not criterion.candidates: ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\resolvelib\structs.py", line 156, in bool return bool(self._sequence) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 155, in bool return any(self) ^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 143, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_built
candidate = func()
^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 182, in _make_candidate_from_link
base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 228, in _make_base_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 293, in init
super().init(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 156, in init
self.dist = self._prepare()
^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 225, in _prepare
dist = self._prepare_distribution()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 304, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\operations\prepare.py", line 525, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\operations\prepare.py", line 640, in _prepare_linked_requirement
dist = _get_prepared_distribution(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\operations\prepare.py", line 71, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\distributions\sdist.py", line 54, in prepare_distribution_metadata
self._install_build_reqs(finder)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\distributions\sdist.py", line 124, in _install_build_reqs
build_reqs = self._get_build_requires_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\distributions\sdist.py", line 101, in _get_build_requires_wheel
return backend.get_requires_for_build_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_internal\utils\misc.py",
line 751, in get_requires_for_build_wheel
return super().get_requires_for_build_wheel(config_settings=cs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_impl.py", line 166, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_impl.py", line 321, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\importlib__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'maturin'
cảm ơn vì thời gian và công sức của bạn