zvtvz / zvt

modular quant framework.
https://zvt.readthedocs.io/en/latest/
MIT License
3.08k stars 843 forks source link

MacBook Pro M3安装出错 #212

Open WilliamZhong opened 2 months ago

WilliamZhong commented 2 months ago

机器:MacBook Pro M3 Max OS:macOS 14.4.1 Python:python3.8

下面是安装的全过程: 10:20:47@15/Apr/2024:~/zvt >>> python3.8 -m venv venv 10:21:07@15/Apr/2024:~/zvt >>> ll drwxr-xr-x - william 15 4 10:21 venv/ 10:21:10@15/Apr/2024:~/zvt >>> source venv/bin/activate.csh [venv] 10:21:21@15/Apr/2024:~/zvt >>> pip list Package Version


pip 23.0.1 setuptools 56.0.0 WARNING: There was an error checking the latest version of pip. [venv] 10:21:56@15/Apr/2024:~/zvt >>> pip install -U pip Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (23.0.1) Collecting pip Downloading pip-24.0-py3-none-any.whl (2.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 2.4 MB/s eta 0:00:00 Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 23.0.1 Uninstalling pip-23.0.1: Successfully uninstalled pip-23.0.1 Successfully installed pip-24.0 WARNING: There was an error checking the latest version of pip. [venv] 10:22:14@15/Apr/2024:~/zvt >>> pip install -U setuptools Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (56.0.0) Collecting setuptools Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB) Using cached setuptools-69.5.1-py3-none-any.whl (894 kB) Installing collected packages: setuptools Attempting uninstall: setuptools Found existing installation: setuptools 56.0.0 Uninstalling setuptools-56.0.0: Successfully uninstalled setuptools-56.0.0 Successfully installed setuptools-69.5.1 [venv] 10:22:24@15/Apr/2024:~/zvt >>> pip install zvt Collecting zvt Using cached zvt-0.10.5-py3-none-any.whl.metadata (38 kB) Collecting requests==2.20.1 (from zvt) Using cached requests-2.20.1-py2.py3-none-any.whl.metadata (5.5 kB) Collecting SQLAlchemy==1.4.20 (from zvt) Using cached SQLAlchemy-1.4.20.tar.gz (7.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting pandas==1.1.4 (from zvt) Using cached pandas-1.1.4.tar.gz (5.2 MB) Installing build dependencies ... error error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [282 lines of output] Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.8" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version >= "3.9"' don't match your environment Collecting setuptools Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB) Collecting wheel Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB) Collecting Cython<3,>=0.29.21 Using cached Cython-0.29.37-py2.py3-none-any.whl.metadata (3.1 kB) Collecting numpy==1.17.3 Downloading numpy-1.17.3.zip (6.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 2.4 MB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Installing backend dependencies: started Installing backend dependencies: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [244 lines of output]
        blas_opt_info:
        blas_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        blis_info:
        customize UnixCCompiler
          libraries blis not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        openblas_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        atlas_3_10_blas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries tatlas not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        atlas_3_10_blas_info:
        customize UnixCCompiler
          libraries satlas not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        atlas_blas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        atlas_blas_info:
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        accelerate_info:
        customize UnixCCompiler
          libraries accelerate not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
        Library accelerate was not found. Ignoring
        customize UnixCCompiler
          libraries veclib not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
        Library veclib was not found. Ignoring
          FOUND:
            extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

          FOUND:
            extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

        /bin/sh: svnversion: command not found
        non-existing path in 'numpy/distutils': 'site.cfg'
        lapack_opt_info:
        lapack_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        openblas_lapack_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        openblas_clapack_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas,lapack not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        flame_info:
        customize UnixCCompiler
          libraries flame not found in ['/Users/william/zvt/venv/lib', '/usr/lib', '/opt/local/lib']
          NOT AVAILABLE

        atlas_3_10_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries lapack_atlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /opt/local/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /opt/local/lib
        <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
          NOT AVAILABLE

        atlas_3_10_info:
        customize UnixCCompiler
          libraries lapack_atlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /opt/local/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /opt/local/lib
        <class 'numpy.distutils.system_info.atlas_3_10_info'>
          NOT AVAILABLE

        atlas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries lapack_atlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /opt/local/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /opt/local/lib
        <class 'numpy.distutils.system_info.atlas_threads_info'>
          NOT AVAILABLE

        atlas_info:
        customize UnixCCompiler
          libraries lapack_atlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /Users/william/zvt/venv/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /opt/local/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /opt/local/lib
        <class 'numpy.distutils.system_info.atlas_info'>
          NOT AVAILABLE

          FOUND:
            extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

        running dist_info
        running build_src
        build_src
        building py_modules sources
        creating build
        creating build/src.macosx-14-arm64-3.8
        creating build/src.macosx-14-arm64-3.8/numpy
        creating build/src.macosx-14-arm64-3.8/numpy/distutils
        building library "npymath" sources
        get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
        customize Gnu95FCompiler
        Found executable /opt/homebrew/bin/gfortran
        Running from numpy source directory.
        <string>:418: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
        /private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py:266: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
        Traceback (most recent call last):
          File "/Users/william/zvt/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
            main()
          File "/Users/william/zvt/venv/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/william/zvt/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 487, in run_setup
            super().run_setup(setup_script=setup_script)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
            exec(code, locals())
          File "<string>", line 443, in <module>
          File "<string>", line 435, in setup_package
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/core.py", line 171, in setup
            return old_setup(**new_attr)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 104, in setup
            return distutils.core.setup(**attrs)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 184, in setup
            return run_commands(dist)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
            dist.run_commands()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
            self.run_command(cmd)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 967, in run_command
            super().run_command(command)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
            cmd_obj.run()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/command/dist_info.py", line 92, in run
            self.egg_info.run()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/command/egg_info.py", line 26, in run
            self.run_command("build_src")
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
            self.distribution.run_command(command)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 967, in run_command
            super().run_command(command)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
            cmd_obj.run()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/command/build_src.py", line 142, in run
            self.build_sources()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/command/build_src.py", line 153, in build_sources
            self.build_library_sources(*libname_info)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/command/build_src.py", line 286, in build_library_sources
            sources = self.generate_sources(sources, (lib_name, build_info))
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/command/build_src.py", line 369, in generate_sources
            source = func(extension, build_dir)
          File "numpy/core/setup.py", line 667, in get_mathlib_info
            st = config_cmd.try_link('int main(void) { return 0;}')
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-build-env-u9z2lln8/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/config.py", line 244, in try_link
            self._check_compiler()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/command/config.py", line 82, in _check_compiler
            self.fcompiler = new_fcompiler(compiler=self.fcompiler,
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/__init__.py", line 884, in new_fcompiler
            compiler = get_default_fcompiler(plat, requiref90=requiref90,
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/__init__.py", line 855, in get_default_fcompiler
            compiler_type =  _find_existing_fcompiler(matching_compiler_types,
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/__init__.py", line 806, in _find_existing_fcompiler
            c.customize(dist)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/__init__.py", line 530, in customize
            linker_so_flags = self.flag_vars.linker_so
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/environment.py", line 40, in __getattr__
            return self._get_var(name, conf_desc)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/environment.py", line 56, in _get_var
            var = self._hook_handler(name, hook)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/__init__.py", line 709, in _environment_hook
            return hook()
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/gnu.py", line 353, in get_flags_linker_so
            flags = GnuFCompiler.get_flags_linker_so(self)
          File "/private/var/folders/68/kf42cbn16bq398f9wh_wz8440000gn/T/pip-install-miqbuis3/numpy_256f2b22bf96471da77f70059e2ed8fa/numpy/distutils/fcompiler/gnu.py", line 144, in get_flags_linker_so
            os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
          File "/opt/homebrew/bin/../Cellar/python@3.8/3.8.19/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 680, in __setitem__
            value = self.encodevalue(value)
          File "/opt/homebrew/bin/../Cellar/python@3.8/3.8.19/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 750, in encode
            raise TypeError("str expected, not %s" % type(value).__name__)
        TypeError: str expected, not int
        [end of output]

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

  × Encountered error while generating package metadata.
  ╰─> See above for output.

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  [end of output]

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

× pip subprocess to install build dependencies 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. [venv] 10:23:16@15/Apr/2024:~/zvt >>

应该是在编译pandas之前的环境依赖是出错,是clang的库链接有问题吗?

WilliamZhong commented 2 months ago

难道是pandas 1.1.4不支持M系列的CPU?

weisong82 commented 1 month ago
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed cleaning build dir for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
  [end of output]

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

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.