PX4 / PX4-windows-toolchain

Repo containing all scripts to install and use the PX4 Toolchain for Windows.
BSD 3-Clause "New" or "Revised" License
31 stars 100 forks source link

Failed to import numpy #26

Closed Yecgaa1 closed 10 months ago

Yecgaa1 commented 3 years ago

Sorry but I put up this issuse in this page but please also help me to solve this problem https://github.com/PX4/PX4-Autopilot/issues/17176 thanks again

Yecgaa1 commented 3 years ago

Numpy is a big question I think

❯ .\install-all-components.bat
* Automated PX4 Toolchain Components Installation
** Installing Cygwin
*** Downloading Cygwin Setup
****  Online  ****
  000000  ...
  14a013
CertUtil: -URLCache command completed successfully.
*** Installing Packages
Package list: cmake,gcc-g++,gdb,git,make,ninja,patch,xxd,nano,unzip,astyle,bash-completion,wget,libcurl-devel,procps-ng,moreutils,python27,python27-pip,python27-numpy,python27-jinja2,python27-tkinter,python3,python36-pip,python36-numpy,python36-jinja2,python36-tkinter
*** Cygwin Installation Done
** Installing Python Packages in Cygwin for PX4 Toolchain
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-YOsdn6/pyulog/setup.py'"'"'; __file__='"'"'/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-YOsdn6/pyulog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-pip-egg-info-tgPVRu
         cwd: /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-YOsdn6/pyulog/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-YOsdn6/pyulog/setup.py", line 14, in <module>
        import versioneer
      File "versioneer.py", line 1739
        file=sys.stderr)
            ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.8.exe /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /cygdrive/c/Users/xtx/AppData/Local/Temp/tmpqu4ivy39
         cwd: /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd
    Complete output (243 lines):
    Processing numpy/random/_bounded_integers.pxd.in
    Processing numpy/random/bit_generator.pyx
    Processing numpy/random/mtrand.pyx
    Processing numpy/random/_bounded_integers.pyx.in
    Processing numpy/random/_common.pyx
    Processing numpy/random/_generator.pyx
    Processing numpy/random/_mt19937.pyx
    Processing numpy/random/_pcg64.pyx
    Processing numpy/random/_philox.pyx
    Processing numpy/random/_sfc64.pyx
    Cythonizing sources
    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    blis_info:
      libraries blis not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_blas_info:
      libraries satlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    blas_info:
      libraries blas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    blas_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    non-existing path in 'numpy/distutils': 'site.cfg'
    lapack_opt_info:
    lapack_mkl_info:
      libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    openblas_clapack_info:
      libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    flame_info:
      libraries flame not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries lapack_atlas not found in /usr/local/lib
      libraries tatlas,tatlas not found in /usr/local/lib
      libraries lapack_atlas not found in /usr/lib
      libraries tatlas,tatlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib/
      libraries tatlas,tatlas not found in /usr/lib/
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
      libraries lapack_atlas not found in /usr/local/lib
      libraries satlas,satlas not found in /usr/local/lib
      libraries lapack_atlas not found in /usr/lib
      libraries satlas,satlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib/
      libraries satlas,satlas not found in /usr/lib/
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

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

    atlas_info:
      libraries lapack_atlas not found in /usr/local/lib
      libraries f77blas,cblas,atlas not found in /usr/local/lib
      libraries lapack_atlas not found in /usr/lib
      libraries f77blas,cblas,atlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib/
      libraries f77blas,cblas,atlas not found in /usr/lib/
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    lapack_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    numpy_linalg_lapack_lite:
      FOUND:
        language = c
        define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]

    running dist_info
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build/src.cygwin-3.1.7-x86_64-3.8
    creating build/src.cygwin-3.1.7-x86_64-3.8/numpy
    creating build/src.cygwin-3.1.7-x86_64-3.8/numpy/distutils
    building library "npymath" sources
    Could not locate executable g77
    Could not locate executable f77
    Could not locate executable ifort
    Could not locate executable ifl
    Could not locate executable f90
    Could not locate executable efl
    Could not locate executable gfortran
    Could not locate executable f95
    Could not locate executable g95
    don't know how to compile Fortran code on platform 'posix'
    creating build/src.cygwin-3.1.7-x86_64-3.8/numpy/core
    creating build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src
    creating build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/npymath
    conv_template:> build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/npymath/npy_math_internal.h
      adding 'build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/npymath' to include_dirs.
    conv_template:> build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/npymath/ieee754.c
    conv_template:> build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/npymath/npy_math_complex.c
    None - nothing done with h_files = ['build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/npymath/npy_math_internal.h']
    building library "npyrandom" sources
    building extension "numpy.core._multiarray_tests" sources
    creating build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/multiarray
    conv_template:> build/src.cygwin-3.1.7-x86_64-3.8/numpy/core/src/multiarray/_multiarray_tests.c
    building extension "numpy.core._multiarray_umath" sources
    Running from numpy source directory.
    setup.py:485: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/system_info.py:1989: UserWarning:
        Optimized (vendor) Blas libraries are not found.
        Falls back to netlib Blas library which has worse performance.
        A better performance should be easily gained by switching
        Blas library.
      if self._calc_info(blas):
    /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/system_info.py:1989: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      if self._calc_info(blas):
    /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/system_info.py:1989: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      if self._calc_info(blas):
    /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/system_info.py:1849: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
    /cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/system_info.py:1849: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
    /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    Traceback (most recent call last):
      File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
        main()
      File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-build-env-n37vlzie/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 157, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-build-env-n37vlzie/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 248, in run_setup
        super(_BuildMetaLegacyBackend,
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-build-env-n37vlzie/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 513, in <module>
        setup_package()
      File "setup.py", line 505, in setup_package
        setup(**metadata)
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/core.py", line 169, in setup
        return old_setup(**new_attr)
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-build-env-n37vlzie/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-build-env-n37vlzie/overlay/lib/python3.8/site-packages/setuptools/command/dist_info.py", line 31, in run
        egg_info.run()
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/command/egg_info.py", line 24, in run
        self.run_command("build_src")
      File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/command/build_src.py", line 144, in run
        self.build_sources()
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/command/build_src.py", line 161, in build_sources
        self.build_extension_sources(ext)
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
        sources = self.generate_sources(sources, ext)
      File "/cygdrive/c/Users/xtx/AppData/Local/Temp/pip-install-s_d1dd6p/numpy_3ec6c1528bb7406ba740a3a752c959dd/numpy/distutils/command/build_src.py", line 378, in generate_sources
        source = func(extension, build_dir)
      File "numpy/core/setup.py", line 444, in generate_config_h
        moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
      File "numpy/core/setup.py", line 49, in check_types
        out = check_types(*a, **kw)
      File "numpy/core/setup.py", line 294, in check_types
        raise SystemError(
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/d2/48/f445be426ccd9b2fb64155ac6730c7212358882e589cd3717477d739d9ff/numpy-1.20.1.zip#sha256=3bc63486a870294683980d76ec1e3efc786295ae00128f9ea38e2c6e74d5a60a (from https://pypi.org/simple/numpy/) (requires-python:>=3.7). Command errored out with exit status 1: /usr/bin/python3.8.exe /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /cygdrive/c/Users/xtx/AppData/Local/Temp/tmpqu4ivy39 Check the logs for full command output.
hamishwillee commented 3 years ago

@MaEtUgR One for you.

@Yecgaa1 If you're blocked on this, you may be able to work using a virtual machine http://docs.px4.io/master/en/dev_setup/dev_env_windows_vm.html

Yecgaa1 commented 10 months ago

I'm sorry this problem has been going on for so long. Yes, using virtual machines can solve this problem.

@MaEtUgR一份给你。

@Yecgaa1如果您被阻止,您也许可以使用虚拟机http://docs.px4.io/master/en/dev_setup/dev_env_windows_vm.html