aliyun / aliyun-openapi-python-sdk

Alibaba Cloud SDK for Python
Other
1k stars 588 forks source link

Cannot import 'aliyunsdkcore.client' on Python 3.13.0a3 #525

Open bdperkin opened 5 months ago

bdperkin commented 5 months ago

On Python 3.13 Alpha 3, we are unable to import 'aliyunsdkcore.client':

$ pip3 install aliyun-python-sdk-core
Collecting aliyun-python-sdk-core
  Using cached aliyun_python_sdk_core-2.14.0-py3-none-any.whl
Collecting jmespath<1.0.0,>=0.9.3 (from aliyun-python-sdk-core)
  Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting cryptography>=2.6.0 (from aliyun-python-sdk-core)
  Obtaining dependency information for cryptography>=2.6.0 from https://files.pythonhosted.org/packages/3c/72/fb557573cebcae88c6efe3a73981181384e08408c1125a8e97a7fb3edde4/cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl.metadata
  Using cached cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.3 kB)
Collecting cffi>=1.12 (from cryptography>=2.6.0->aliyun-python-sdk-core)
  Using cached cffi-1.16.0-cp313-cp313-linux_x86_64.whl
Collecting pycparser (from cffi>=1.12->cryptography>=2.6.0->aliyun-python-sdk-core)
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl (4.7 MB)
Installing collected packages: pycparser, jmespath, cffi, cryptography, aliyun-python-sdk-core
Successfully installed aliyun-python-sdk-core-2.14.0 cffi-1.16.0 cryptography-42.0.2 jmespath-0.10.0 pycparser-2.21

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
$ python -c "import aliyunsdkcore.client"
ImportError: /tmp/venv-python3.13/lib64/python3.13/site-packages/_cffi_backend.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyErr_WriteUnraisableMsg
thread '<unnamed>' panicked at /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.20.2/src/err/mod.rs:788:5:
Python API call failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import aliyunsdkcore.client
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/client.py", line 40, in <module>
    from aliyunsdkcore.auth.signers.signer_factory import SignerFactory
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/auth/signers/signer_factory.py", line 13, in <module>
    from aliyunsdkcore.auth.signers import rsa_key_pair_signer
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/auth/signers/rsa_key_pair_signer.py", line 12, in <module>
    from aliyunsdkcore.auth.algorithm import sha_hmac256
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac256.py", line 21, in <module>
    from cryptography.hazmat.primitives import hashes
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/cryptography/hazmat/primitives/hashes.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import openssl as rust_openssl
pyo3_runtime.PanicException: Python API call failed
$ python --version
Python 3.13.0a3
$ python
Python 3.13.0a3 (main, Jan 18 2024, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aliyunsdkcore
>>> print(aliyunsdkcore.__version__)
2.14.0