Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os 系统安装错误,编译错误 #134

Open
bailixuance opened this issue Dec 11, 2023 · 8 comments
Open

os 系统安装错误,编译错误 #134

bailixuance opened this issue Dec 11, 2023 · 8 comments

Comments

@bailixuance
Copy link

在 mac os 系统中安装 toad 不成功,编译错误

在Python 3.9 下,0.1.2、0.1.3 两个版本均安装不成功

在python 3.8 下,0.1.2 安装成功,0.1.3 安装失败

系统信息#

uname -a
Darwin MacBook-Pro.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

python3.9.7 下安装toad-0.1.3报错如下:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting toad
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c1/01/950686b959c0171a0bf1c7845ab346e42c980157ba9dcd7f2f95de556add/toad-0.1.3.tar.gz (14.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [191 lines of output]

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport numpy as np
      cimport cython



      cdef number c_min(number[:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:9:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport numpy as np
      cimport cython



      cdef number c_min(number[:] arr):
                        ^
      ------------------------------------------------------------

      toad/c_utils.pyx:9:18: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if res > arr[i]:
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:18:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if res > arr[i]:
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
                        ^
      ------------------------------------------------------------

      toad/c_utils.pyx:18:18: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res += arr[i, j]

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:29:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res += arr[i, j]

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
                                  ^
      ------------------------------------------------------------

      toad/c_utils.pyx:29:28: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res[j] += arr[i, j]

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:39:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res[j] += arr[i, j]

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
                                  ^
      ------------------------------------------------------------

      toad/c_utils.pyx:39:28: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport cython



      cdef number c_min(number[:] arr):
          cdef number res = np.inf
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:10:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
          cdef number res = 0
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:19:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[1], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:30:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[0], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:40:9: 'number' is not a type identifier
      Compiling toad/c_utils.pyx because it depends on [/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/Cython/Includes/cpython/type.pxd.](https://file+.vscode-resource.vscode-cdn.net/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/Cython/Includes/cpython/type.pxd.)
      Compiling toad/merge.pyx because it depends on [/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/Cython/Includes/cpython/type.pxd.](https://file+.vscode-resource.vscode-cdn.net/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/Cython/Includes/cpython/type.pxd.)
      [1/2] Cythonizing toad/c_utils.pyx
      Traceback (most recent call last):
        File "/Users/ml/opt/anaconda3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/ml/opt/anaconda3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/ml/opt/anaconda3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 59, in <module>
        File "<string>", line 27, in get_ext_modules
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-c6e3136p/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: toad/c_utils.pyx
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

python3.9.7 下安装toad-0.1.2报错如下:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting toad==0.1.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/80/f2/cdc57737b090ac1cc0e077469e9a1bd97234c8aa5d18014469f921a186be/toad-0.1.2.tar.gz (14.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [191 lines of output]

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport numpy as np
      cimport cython



      cdef number c_min(number[:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:9:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport numpy as np
      cimport cython



      cdef number c_min(number[:] arr):
                        ^
      ------------------------------------------------------------

      toad/c_utils.pyx:9:18: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if res > arr[i]:
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:18:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if res > arr[i]:
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
                        ^
      ------------------------------------------------------------

      toad/c_utils.pyx:18:18: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res += arr[i, j]

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:29:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res += arr[i, j]

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
                                  ^
      ------------------------------------------------------------

      toad/c_utils.pyx:29:28: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res[j] += arr[i, j]

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:39:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res[j] += arr[i, j]

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
                                  ^
      ------------------------------------------------------------

      toad/c_utils.pyx:39:28: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport cython



      cdef number c_min(number[:] arr):
          cdef number res = np.inf
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:10:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
          cdef number res = 0
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:19:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[1], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:30:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[0], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:40:9: 'number' is not a type identifier
      Compiling toad/c_utils.pyx because it changed.
      Compiling toad/merge.pyx because it changed.
      [1/2] Cythonizing toad/c_utils.pyx
      Traceback (most recent call last):
        File "/Users/liujunjie/opt/anaconda3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/liujunjie/opt/anaconda3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/liujunjie/opt/anaconda3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-uwlyg2eq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-uwlyg2eq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-uwlyg2eq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 59, in <module>
        File "<string>", line 27, in get_ext_modules
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-uwlyg2eq/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-uwlyg2eq/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: toad/c_utils.pyx
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

python3.8.18 下安装toad-0.1.3报错如下:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting toad
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c1/01/950686b959c0171a0bf1c7845ab346e42c980157ba9dcd7f2f95de556add/toad-0.1.3.tar.gz (14.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [191 lines of output]

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport numpy as np
      cimport cython



      cdef number c_min(number[:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:9:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport numpy as np
      cimport cython



      cdef number c_min(number[:] arr):
                        ^
      ------------------------------------------------------------

      toad/c_utils.pyx:9:18: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if res > arr[i]:
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:18:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if res > arr[i]:
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
                        ^
      ------------------------------------------------------------

      toad/c_utils.pyx:18:18: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res += arr[i, j]

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:29:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res += arr[i, j]

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
                                  ^
      ------------------------------------------------------------

      toad/c_utils.pyx:29:28: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res[j] += arr[i, j]

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
           ^
      ------------------------------------------------------------

      toad/c_utils.pyx:39:5: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res[j] += arr[i, j]

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
                                  ^
      ------------------------------------------------------------

      toad/c_utils.pyx:39:28: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cimport cython



      cdef number c_min(number[:] arr):
          cdef number res = np.inf
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:10:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  res = arr[i]
          return res


      cdef number c_sum(number[:,:] arr):
          cdef number res = 0
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:19:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          return res


      cdef number[:] c_sum_axis_0(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[1], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:30:9: 'number' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          return res


      cdef number[:] c_sum_axis_1(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[0], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:40:9: 'number' is not a type identifier
      Compiling toad/c_utils.pyx because it depends on [/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd.](https://file+.vscode-resource.vscode-cdn.net/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd.)
      Compiling toad/merge.pyx because it depends on [/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd.](https://file+.vscode-resource.vscode-cdn.net/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd.)
      [1/2] Cythonizing toad/c_utils.pyx
      Traceback (most recent call last):
        File "/Users/ml/opt/anaconda3/envs/nebula_38/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/ml/opt/anaconda3/envs/nebula_38/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/ml/opt/anaconda3/envs/nebula_38/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 59, in <module>
        File "<string>", line 27, in get_ext_modules
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/85/zgjq0fyd26z709rf7l1kgglh0000gp/T/pip-build-env-p1kz21uz/overlay/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: toad/c_utils.pyx
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
@bailixuance
Copy link
Author

@bailixuance 尝试使用 https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2a/1e/c2a46acb887f7d65d315efb99fee2c41e4678b3bc741ff554c6b42bb1d8c/toad-0.1.3-cp39-cp39-macosx_11_0_x86_64.whl 这个编译好的包安装试试呢?

不行,安装失败,python 也是3.9的

ERROR: toad-0.1.3-cp39-cp39-macosx_11_0_x86_64.whl is not a supported wheel on this platform.

@Secbone
Copy link
Member

Secbone commented Dec 12, 2023

@bailixuance 你是 M1 版本的 Mac 么?如果是的话,可能暂时没有预先编译好的版本。不过还有一个方案可以试一下:

升级 Cythonnumpy 到最新版本,这个两个是编译 toad 时需要的依赖包,版本不一致时可能会有问题,但是因为手头暂时没有 M1 的环境,之前也都没有在M1上编译过,不太确定是否一定会编译成功

我最近会尝试编译 arm 版的包出来,不过目前的信息来看,可能也只能支持到 3.10 及以上,可能不包括 3.9 😞 actions/setup-python#696

如果你愿意帮助我的话,也可以成为开发者一起发布新版本的包 😄

@bailixuance
Copy link
Author

@bailixuance 你是 M1 版本的 Mac 么?如果是的话,可能暂时没有预先编译好的版本。不过还有一个方案可以试一下:

升级 Cythonnumpy 到最新版本,这个两个是编译 toad 时需要的依赖包,版本不一致时可能会有问题,但是因为手头暂时没有 M1 的环境,之前也都没有在M1上编译过,不太确定是否一定会编译成功

我最近会尝试编译 arm 版的包出来,不过目前的信息来看,可能也只能支持到 3.10 及以上,可能不包括 3.9 😞 actions/setup-python#696

如果你愿意帮助我的话,也可以成为开发者一起发布新版本的包 😄

系统不是M1的,是常规 intel cpu。

试了下,更新了cython、numpy 到最新版本也不行,pip install toad 或者安装离线 whl 包都不行,环境如下:

python=3.9.7
cython=3.0.6
numpy=1.26.2

时间充足的话,可以给你测试下什么的,哈哈😄

@Secbone
Copy link
Member

Secbone commented Dec 12, 2023

@bailixuance 我本地用同样的环境测试了一下可以正常编译,上面的 whl 文件也是正常安装
重新看了一下你上面的报错信息,感觉是cython版本太低的问题,所以我觉得你可能需要确认一下编译的时候是否是用的最新的cython

@bailixuance
Copy link
Author

@bailixuance 我本地用同样的环境测试了一下可以正常编译,上面的 whl 文件也是正常安装 重新看了一下你上面的报错信息,感觉是cython版本太低的问题,所以我觉得你可能需要确认一下编译的时候是否是用的最新的cython

好奇怪,在base 环境中,直接 pip install toad,会去下载 toad-0.1.3.tar.gz 包,然后编译失败。直接安装 whl 包,也是编译失败。cython, numpy 确认都是最新的。

换了一个环境,也是Python 3.9.7,直接pip install toad, 反而去下载 whl 包,然后安装成功:

Collecting toad
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2a/1e/c2a46acb887f7d65d315efb99fee2c41e4678b3bc741ff554c6b42bb1d8c/toad-0.1.3-cp39-cp39-macosx_11_0_x86_64.whl (14.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.3/14.3 MB 30.6 MB/s eta 0:00:00
Installing collected packages: toad
Successfully installed toad-0.1.3

这个环境中,甚至都没有安装cython,numpy 也不是最新的。在这个环境中直接安装 离线whl包也是没问题的。
太奇怪了

@DjokerR
Copy link

DjokerR commented Feb 23, 2024

os: openeuler-arm64
python: 3.9.17

1、下载toad-0.1.3.tar.gz 并解压到/tmp 目录下
tar -zxvf toad-0.1.3.tar.gz -C /tmp/

2、 pip --version 找到python site-packages 路径
比如我的是/opt/conda/lib/python3.9/site-packages

3、将解压后的toad下所有的文件拷贝到site-packages 路径下
cp -r /tmp/toad-0.1.3/* /opt/conda/lib/python3.9/site-packages

4、到site-packages 路径下 pip install toad
cd /opt/conda/lib/python3.9/site-packages && pip install toad

5、到任意目录下执行python -c "import toad ;print(toad.version)"

6、注意: 如果不将toad 放到python site-packages目录下,是无法在任意目录import toad

@HWTsang
Copy link

HWTsang commented Jul 11, 2024

os: openeuler-arm64 python: 3.9.17

1、下载toad-0.1.3.tar.gz 并解压到/tmp 目录下 tar -zxvf toad-0.1.3.tar.gz -C /tmp/

2、 pip --version 找到python site-packages 路径 比如我的是/opt/conda/lib/python3.9/site-packages

3、将解压后的toad下所有的文件拷贝到site-packages 路径下 cp -r /tmp/toad-0.1.3/* /opt/conda/lib/python3.9/site-packages

4、到site-packages 路径下 pip install toad cd /opt/conda/lib/python3.9/site-packages && pip install toad

5、到任意目录下执行python -c "import toad ;print(toad.version)"

6、注意: 如果不将toad 放到python site-packages目录下,是无法在任意目录import toad

方法可行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants