Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Unable to install mlagents due to errors with NumPy and Microsoft Visual Studio C++

Discussion in 'ML-Agents' started by bobbete, Jan 15, 2023.

  1. bobbete

    bobbete

    Joined:
    Dec 1, 2018
    Posts:
    2
    I've been trying to install mlagents without success for a full day, but nothing I do works to bypass this error message. I am trying to install it on a virtual environment on a Windows 10, using Python 3.10.8, NumPy 1.22.4, PyTorch 1.13.1. I don't understand the error because I have a different versionof NumPy than the one the error says. And I also installed Visual Studio C++, which is an error at the end. Any help is appreciated, thanks :)



    Code (CSharp):
    1. Building wheels for collected packages: numpy
    2.   Building wheel for numpy (pyproject.toml) ... error
    3.   error: subprocess-exited-with-error
    4.  
    5.   × Building wheel for numpy (pyproject.toml) did not run successfully.
    6.   │ exit code: 1
    7.   ╰─> [198 lines of output]
    8.       setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
    9.         warnings.warn(
    10.       Running from numpy source directory.
    11.       Processing numpy/random\_bounded_integers.pxd.in
    12.       Processing numpy/random\bit_generator.pyx
    13.       Processing numpy/random\mtrand.pyx
    14.       Processing numpy/random\_bounded_integers.pyx.in
    15.       Processing numpy/random\_common.pyx
    16.       Processing numpy/random\_generator.pyx
    17.       Processing numpy/random\_mt19937.pyx
    18.       Processing numpy/random\_pcg64.pyx
    19.       Processing numpy/random\_philox.pyx
    20.       Processing numpy/random\_sfc64.pyx
    21.       Cythonizing sources
    22.       blas_opt_info:
    23.       blas_mkl_info:
    24.       No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    25.       customize MSVCCompiler
    26.         libraries mkl_rt not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    27.         NOT AVAILABLE
    28.  
    29.       blis_info:
    30.         libraries blis not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    31.         NOT AVAILABLE
    32.  
    33.       openblas_info:
    34.         libraries openblas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    35.       get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
    36.       customize GnuFCompiler
    37.       Could not locate executable g77
    38.       Could not locate executable f77
    39.       customize IntelVisualFCompiler
    40.       Could not locate executable ifort
    41.       Could not locate executable ifl
    42.       customize AbsoftFCompiler
    43.       Could not locate executable f90
    44.       customize CompaqVisualFCompiler
    45.       Could not locate executable DF
    46.       customize IntelItaniumVisualFCompiler
    47.       Could not locate executable efl
    48.       customize Gnu95FCompiler
    49.       Could not locate executable gfortran
    50.       Could not locate executable f95
    51.       customize G95FCompiler
    52.       Could not locate executable g95
    53.       customize IntelEM64VisualFCompiler
    54.       customize IntelEM64TFCompiler
    55.       Could not locate executable efort
    56.       Could not locate executable efc
    57.       customize PGroupFlangCompiler
    58.       Could not locate executable flang
    59.       don't know how to compile Fortran code on platform 'nt'
    60.        NOT AVAILABLE
    61.  
    62.      accelerate_info:
    63.        NOT AVAILABLE
    64.  
    65.      atlas_3_10_blas_threads_info:
    66.      Setting PTATLAS=ATLAS
    67.        libraries tatlas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    68.        NOT AVAILABLE
    69.  
    70.      atlas_3_10_blas_info:
    71.        libraries satlas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    72.        NOT AVAILABLE
    73.  
    74.      atlas_blas_threads_info:
    75.      Setting PTATLAS=ATLAS
    76.        libraries ptf77blas,ptcblas,atlas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    77.        NOT AVAILABLE
    78.  
    79.      atlas_blas_info:
    80.        libraries f77blas,cblas,atlas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    81.        NOT AVAILABLE
    82.  
    83.      C:\Users\GorillaPenguin\AppData\Local\Temp\pip-install-dtzunq9p\numpy_77a55582e5d344b497a4063966d72ff1\numpy\distutils\system_info.py:2026: UserWarning:
    84.          Optimized (vendor) Blas libraries are not found.
    85.          Falls back to netlib Blas library which has worse performance.
    86.          A better performance should be easily gained by switching
    87.          Blas library.
    88.        if self._calc_info(blas):
    89.      blas_info:
    90.        libraries blas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    91.        NOT AVAILABLE
    92.  
    93.      C:\Users\GorillaPenguin\AppData\Local\Temp\pip-install-dtzunq9p\numpy_77a55582e5d344b497a4063966d72ff1\numpy\distutils\system_info.py:2026: UserWarning:
    94.          Blas (http://www.netlib.org/blas/) libraries not found.
    95.          Directories to search for the libraries can be specified in the
    96.          numpy/distutils/site.cfg file (section [blas]) or by setting
    97.          the BLAS environment variable.
    98.        if self._calc_info(blas):
    99.      blas_src_info:
    100.        NOT AVAILABLE
    101.  
    102.      C:\Users\GorillaPenguin\AppData\Local\Temp\pip-install-dtzunq9p\numpy_77a55582e5d344b497a4063966d72ff1\numpy\distutils\system_info.py:2026: UserWarning:
    103.          Blas (http://www.netlib.org/blas/) sources not found.
    104.          Directories to search for the sources can be specified in the
    105.          numpy/distutils/site.cfg file (section [blas_src]) or by setting
    106.          the BLAS_SRC environment variable.
    107.        if self._calc_info(blas):
    108.        NOT AVAILABLE
    109.  
    110.      non-existing path in 'numpy\\distutils': 'site.cfg'
    111.      lapack_opt_info:
    112.      lapack_mkl_info:
    113.        libraries mkl_rt not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    114.        NOT AVAILABLE
    115.  
    116.      openblas_lapack_info:
    117.        libraries openblas not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    118.        NOT AVAILABLE
    119.  
    120.      openblas_clapack_info:
    121.        libraries openblas,lapack not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    122.        NOT AVAILABLE
    123.  
    124.      flame_info:
    125.        libraries flame not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    126.        NOT AVAILABLE
    127.  
    128.      atlas_3_10_threads_info:
    129.      Setting PTATLAS=ATLAS
    130.        libraries lapack_atlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    131.        libraries tatlas,tatlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    132.        libraries lapack_atlas not found in C:\
    133.        libraries tatlas,tatlas not found in C:\
    134.      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    135.        NOT AVAILABLE
    136.  
    137.      atlas_3_10_info:
    138.        libraries lapack_atlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    139.        libraries satlas,satlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    140.        libraries lapack_atlas not found in C:\
    141.        libraries satlas,satlas not found in C:\
    142.      <class 'numpy.distutils.system_info.atlas_3_10_info'>
    143.        NOT AVAILABLE
    144.  
    145.      atlas_threads_info:
    146.      Setting PTATLAS=ATLAS
    147.        libraries lapack_atlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    148.        libraries ptf77blas,ptcblas,atlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    149.        libraries lapack_atlas not found in C:\
    150.        libraries ptf77blas,ptcblas,atlas not found in C:\
    151.      <class 'numpy.distutils.system_info.atlas_threads_info'>
    152.        NOT AVAILABLE
    153.  
    154.      atlas_info:
    155.        libraries lapack_atlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    156.        libraries f77blas,cblas,atlas not found in D:\Unity\ReinforcementLeaning_InfoProject\venv\lib
    157.        libraries lapack_atlas not found in C:\
    158.        libraries f77blas,cblas,atlas not found in C:\
    159.      <class 'numpy.distutils.system_info.atlas_info'>
    160.        NOT AVAILABLE
    161.  
    162.      lapack_info:
    163.        libraries lapack not found in ['D:\\Unity\\ReinforcementLeaning_InfoProject\\venv\\lib', 'C:\\']
    164.        NOT AVAILABLE
    165.  
    166.      C:\Users\GorillaPenguin\AppData\Local\Temp\pip-install-dtzunq9p\numpy_77a55582e5d344b497a4063966d72ff1\numpy\distutils\system_info.py:1858: UserWarning:
    167.          Lapack (http://www.netlib.org/lapack/) libraries not found.
    168.          Directories to search for the libraries can be specified in the
    169.          numpy/distutils/site.cfg file (section [lapack]) or by setting
    170.          the LAPACK environment variable.
    171.        return getattr(self, '_calc_info_{}'.format(name))()
    172.      lapack_src_info:
    173.        NOT AVAILABLE
    174.  
    175.      C:\Users\GorillaPenguin\AppData\Local\Temp\pip-install-dtzunq9p\numpy_77a55582e5d344b497a4063966d72ff1\numpy\distutils\system_info.py:1858: UserWarning:
    176.          Lapack (http://www.netlib.org/lapack/) sources not found.
    177.          Directories to search for the sources can be specified in the
    178.          numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    179.          the LAPACK_SRC environment variable.
    180.        return getattr(self, '_calc_info_{}'.format(name))()
    181.        NOT AVAILABLE
    182.  
    183.      numpy_linalg_lapack_lite:
    184.        FOUND:
    185.          language = c
    186.          define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]
    187.  
    188.      Warning: attempted relative import with no known parent package
    189.      C:\Users\GorillaPenguin\AppData\Local\Temp\pip-build-env-lxfte5ec\overlay\Lib\site-packages\setuptools\_distutils\dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
    190.        warnings.warn(msg)
    191.      running bdist_wheel
    192.      running build
    193.      running config_cc
    194.      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    195.      running config_fc
    196.      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    197.      running build_src
    198.      build_src
    199.      building py_modules sources
    200.      creating build
    201.      creating build\src.win-amd64-3.10
    202.      creating build\src.win-amd64-3.10\numpy
    203.      creating build\src.win-amd64-3.10\numpy\distutils
    204.      building library "npymath" sources
    205.      error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    206.      [end of output]
    207.  
    208.  note: This error originates from a subprocess, and is likely not a problem with pip.
    209.  ERROR: Failed building wheel for numpy
    210. Failed to build numpy
    211. ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
     
  2. bobbete

    bobbete

    Joined:
    Dec 1, 2018
    Posts:
    2
    I have fixed it by uninstalling everything and following the official installation tutorial using Python 3.9
     
    hughperkins likes this.
  3. JustnTrying

    JustnTrying

    Joined:
    Sep 24, 2021
    Posts:
    7
    This is a known bug, and a fix is hopefully soon merged and deployed
     
  4. sambutle

    sambutle

    Joined:
    Sep 6, 2022
    Posts:
    2
    When attempting a relative import in Python, you may encounter an error message that says "attempted relative import with no known parent package." This error message is usually triggered when you are trying to import a module from a package using a relative import, but the package's name is not recognized by Python as a valid package.

    To fix this error, you need to make sure that the module being imported is part of a package, and that the package is on the Python path. You can do this by adding an empty __init__.py file to the package's directory, and by making sure that the directory containing the package is on the Python path.

    Also, you can try one or more of the following solutions:
    • Use an absolute import instead of a relative import.
    • Ensure that the package's name is spelled correctly and that the package is located in a directory that Python can find.
    • Make sure that the package's directory contains an __init__.py file, which is required for Python to recognize the directory as a package.
    • Check that you are running your Python script or program from the correct directory, which contains the package you are trying to import.
    • Consider restructuring your project to avoid using relative imports altogether.