Skip to content
New issue

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

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

Already on GitHub? # to your account

Issue installing on Mac M1 #490

Closed
roohy466 opened this issue Jul 18, 2023 · 5 comments · Fixed by #491
Closed

Issue installing on Mac M1 #490

roohy466 opened this issue Jul 18, 2023 · 5 comments · Fixed by #491

Comments

@roohy466
Copy link

roohy466 commented Jul 18, 2023

Dear

I am trying to install pycortex however with two version of python 3.9, 3.11 I get the same error!

    pip install -U pycortex
    Collecting pycortex
      Using cached pycortex-1.2.6.tar.gz (37.2 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
      ╰─> [381 lines of output]
          <string>:5: DeprecationWarning:
  
    `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
    of the deprecation of `distutils` itself. It will be removed for
    Python >= 3.12. For older Python versions it will remain present.
    It is recommended to use `setuptools < 60.0` for those Python versions.
    For more details, see:
      https://numpy.org/devdocs/reference/distutils_status_migration.html
  
  
  /private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-install-4dvc4mg3/pycortex_37c7d06a66db4394ab5f7db71ab6585f/cortex/formats.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  warning: cortex/formats.pyx:114:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  warning: cortex/formats.pyx:114:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
  /private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-install-4dvc4mg3/pycortex_37c7d06a66db4394ab5f7db71ab6585f/cortex/openctm.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  import sys
  import numpy as np
  
  cimport cython
  cimport openctm
          ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:5:8: 'openctm.pxd' not found
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef object norms
      cdef public dict attribs
      cdef public dict uvs
  
      def __cinit__(self, object filename, str mode='r'):
          cdef openctm.CTMenum err
               ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:43:13: 'CTMenum' is not a type identifier
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          return pts, polys, norms
  
      def save(self, method='mg2', int level=9):
          cdef char* cname = NULL
          cdef float* cnorms = NULL
          cdef openctm.CTMenum err
               ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:152:13: 'CTMenum' is not a type identifier
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  
      def save(self, method='mg2', int level=9):
          cdef char* cname = NULL
          cdef float* cnorms = NULL
          cdef openctm.CTMenum err
          cdef openctm.CTMenum ctmmeth
               ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:153:13: 'CTMenum' is not a type identifier
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  cimport cython
  cimport openctm
  cimport numpy as np
  
  uvmaps = [
      openctm.CTM_UV_MAP_1,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:9:11: cimported module has no attribute 'CTM_UV_MAP_1'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  cimport openctm
  cimport numpy as np
  
  uvmaps = [
      openctm.CTM_UV_MAP_1,
      openctm.CTM_UV_MAP_2,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:10:11: cimported module has no attribute 'CTM_UV_MAP_2'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  cimport numpy as np
  
  uvmaps = [
      openctm.CTM_UV_MAP_1,
      openctm.CTM_UV_MAP_2,
      openctm.CTM_UV_MAP_3,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:11:11: cimported module has no attribute 'CTM_UV_MAP_3'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  
  uvmaps = [
      openctm.CTM_UV_MAP_1,
      openctm.CTM_UV_MAP_2,
      openctm.CTM_UV_MAP_3,
      openctm.CTM_UV_MAP_4,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:12:11: cimported module has no attribute 'CTM_UV_MAP_4'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  uvmaps = [
      openctm.CTM_UV_MAP_1,
      openctm.CTM_UV_MAP_2,
      openctm.CTM_UV_MAP_3,
      openctm.CTM_UV_MAP_4,
      openctm.CTM_UV_MAP_5,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:13:11: cimported module has no attribute 'CTM_UV_MAP_5'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_UV_MAP_1,
      openctm.CTM_UV_MAP_2,
      openctm.CTM_UV_MAP_3,
      openctm.CTM_UV_MAP_4,
      openctm.CTM_UV_MAP_5,
      openctm.CTM_UV_MAP_6,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:14:11: cimported module has no attribute 'CTM_UV_MAP_6'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_UV_MAP_2,
      openctm.CTM_UV_MAP_3,
      openctm.CTM_UV_MAP_4,
      openctm.CTM_UV_MAP_5,
      openctm.CTM_UV_MAP_6,
      openctm.CTM_UV_MAP_7,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:15:11: cimported module has no attribute 'CTM_UV_MAP_7'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_UV_MAP_3,
      openctm.CTM_UV_MAP_4,
      openctm.CTM_UV_MAP_5,
      openctm.CTM_UV_MAP_6,
      openctm.CTM_UV_MAP_7,
      openctm.CTM_UV_MAP_8,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:16:11: cimported module has no attribute 'CTM_UV_MAP_8'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_UV_MAP_6,
      openctm.CTM_UV_MAP_7,
      openctm.CTM_UV_MAP_8,
  ]
  attrmaps = [
      openctm.CTM_ATTRIB_MAP_1,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:19:11: cimported module has no attribute 'CTM_ATTRIB_MAP_1'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_UV_MAP_7,
      openctm.CTM_UV_MAP_8,
  ]
  attrmaps = [
      openctm.CTM_ATTRIB_MAP_1,
      openctm.CTM_ATTRIB_MAP_2,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:20:11: cimported module has no attribute 'CTM_ATTRIB_MAP_2'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_UV_MAP_8,
  ]
  attrmaps = [
      openctm.CTM_ATTRIB_MAP_1,
      openctm.CTM_ATTRIB_MAP_2,
      openctm.CTM_ATTRIB_MAP_3,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:21:11: cimported module has no attribute 'CTM_ATTRIB_MAP_3'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  ]
  attrmaps = [
      openctm.CTM_ATTRIB_MAP_1,
      openctm.CTM_ATTRIB_MAP_2,
      openctm.CTM_ATTRIB_MAP_3,
      openctm.CTM_ATTRIB_MAP_4,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:22:11: cimported module has no attribute 'CTM_ATTRIB_MAP_4'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  attrmaps = [
      openctm.CTM_ATTRIB_MAP_1,
      openctm.CTM_ATTRIB_MAP_2,
      openctm.CTM_ATTRIB_MAP_3,
      openctm.CTM_ATTRIB_MAP_4,
      openctm.CTM_ATTRIB_MAP_5,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:23:11: cimported module has no attribute 'CTM_ATTRIB_MAP_5'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_ATTRIB_MAP_1,
      openctm.CTM_ATTRIB_MAP_2,
      openctm.CTM_ATTRIB_MAP_3,
      openctm.CTM_ATTRIB_MAP_4,
      openctm.CTM_ATTRIB_MAP_5,
      openctm.CTM_ATTRIB_MAP_6,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:24:11: cimported module has no attribute 'CTM_ATTRIB_MAP_6'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_ATTRIB_MAP_2,
      openctm.CTM_ATTRIB_MAP_3,
      openctm.CTM_ATTRIB_MAP_4,
      openctm.CTM_ATTRIB_MAP_5,
      openctm.CTM_ATTRIB_MAP_6,
      openctm.CTM_ATTRIB_MAP_7,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:25:11: cimported module has no attribute 'CTM_ATTRIB_MAP_7'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      openctm.CTM_ATTRIB_MAP_3,
      openctm.CTM_ATTRIB_MAP_4,
      openctm.CTM_ATTRIB_MAP_5,
      openctm.CTM_ATTRIB_MAP_6,
      openctm.CTM_ATTRIB_MAP_7,
      openctm.CTM_ATTRIB_MAP_8,
             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:26:11: cimported module has no attribute 'CTM_ATTRIB_MAP_8'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
              err = ctmGetError(self.ctx)
              if err != openctm.CTM_NONE:
                  raise IOError(openctm.ctmErrorString(err))
  
              nuv = openctm.ctmGetInteger(self.ctx, openctm.CTM_UV_MAP_COUNT)
              nattr = openctm.ctmGetInteger(self.ctx, openctm.CTM_ATTRIB_MAP_COUNT)
                             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:58:27: cimported module has no attribute 'ctmGetInteger'
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
              err = ctmGetError(self.ctx)
              if err != openctm.CTM_NONE:
                  raise IOError(openctm.ctmErrorString(err))
  
              nuv = openctm.ctmGetInteger(self.ctx, openctm.CTM_UV_MAP_COUNT)
              nattr = openctm.ctmGetInteger(self.ctx, openctm.CTM_ATTRIB_MAP_COUNT)
                             ^
  ------------------------------------------------------------
  
  cortex/openctm.pyx:58:27: Compiler crash in AnalyseExpressionsTransform
  
  ModuleNode.body = StatListNode(openctm.pyx:1:0)
  StatListNode.stats[7] = StatListNode(openctm.pyx:29:5)
  StatListNode.stats[0] = CClassDefNode(openctm.pyx:29:5,
      as_name = 'CTMfile',
      class_name = 'CTMfile',
      module_name = '',
      punycode_class_name = 'CTMfile',
      visibility = 'private')
  CClassDefNode.body = StatListNode(openctm.pyx:30:4)
  StatListNode.stats[0] = DefNode(openctm.pyx:42:4,
      modifiers = [...]/0,
      name = '__cinit__',
      np_args_idx = [...]/0,
      num_required_args = 2,
      outer_attrs = [...]/2,
      py_wrapper_required = True,
      reqd_kw_flags_cname = '0',
      used = True)
  File 'ExprNodes.py', line 5844, in infer_type: SimpleCallNode(openctm.pyx:58:41,
      result_is_used = True,
      use_managed_ref = True)
  File 'ExprNodes.py', line 7288, in infer_type: AttributeNode(openctm.pyx:58:27,
      attribute = 'ctmGetInteger',
      is_attribute = 1,
      needs_none_check = True,
      result_is_used = True,
      use_managed_ref = True)
  
  Compiler crash traceback from this point on:
    File "/private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/Cython/Compiler/ExprNodes.py", line 7288, in infer_type
      if node.entry.type and node.entry.type.is_cfunction:
  AttributeError: 'NoneType' object has no attribute 'type'
  Compiling cortex/openctm.pyx because it changed.
  Compiling cortex/formats.pyx because it changed.
  [1/2] Cythonizing cortex/formats.pyx
  [2/2] Cythonizing cortex/openctm.pyx
  Traceback (most recent call last):
    File "/Users/user/python-envs/fastsurfer/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/user/python-envs/fastsurfer/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/user/python-envs/fastsurfer/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/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 487, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 131, in <module>
    File "/private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
      cythonize_one(*args)
    File "/private/var/folders/mc/b_zx4_ps5lvdnbdh813p_l3w0000gq/T/pip-build-env-xkhqyyua/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: cortex/openctm.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.`
@amarvi1
Copy link

amarvi1 commented Jul 20, 2023

Having the same issue on an intel Mac. Tried installing with multiple versions of python and setuptools, and in a local and conda virtual env.

@mvdoc
Copy link
Contributor

mvdoc commented Jul 20, 2023

I can confirm the same issue is occurring on my macbook pro M1. I'm not 100% sure that the issue is strictly related to the M1 chip. The issue is caused by the new Cython 3.0.0 that was released a couple of days ago. I will push a fix for pycortex soon.

@mvdoc
Copy link
Contributor

mvdoc commented Jul 20, 2023

@roohy466 @amarvi1 I pushed version 1.2.7 to pypi. Can you try to run pip install -U pycortex==1.2.7 and check if that solved the issue for both of you?

@roohy466
Copy link
Author

roohy466 commented Jul 20, 2023

Thanks it works with my python 3.9 but give the same error with python 3.11! for python 3.11 , I could install it with downgrading my cython:
pip install -U cython==0.29.36

@amarvi1
Copy link

amarvi1 commented Jul 20, 2023

@mvdoc worked for me! using python 3.11 in a clean conda env

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

Successfully merging a pull request may close this issue.

3 participants