skip to Main Content

I am trying to install the capytaine package using pip (pip install capytaine) (in VS Code).
Unfortunately I am getting multiple errors, although other packages such as numpy, matplotlib etc. are installed and run successfully. I have beginner to intermediate python and general programming skills, however I struggle solving delicate issues, such as dealing with errors I encountered here. Therefore, I am not sure whether the errors are caused by wheel, setup.py or some path related mistake.
I have already went through some other discussions, but couldn’t find a useful resource for my problem, neither has installing C++ build tools recommended by VS Code helped.

I’ve got Python 3.9.13, wheel 0.37.1 and setuptools 65.3.0 on my computer. (Should I downgrade setuptools to below 60 version? how?)

I would really appreciate if you could assist me resolve the installation issues here.

I’ve cropped the irrelevant parts of the output after running pip install capytaine to fit
the character requirements, hope it’s not gibberish.


PS D:TUHHMasterMasterarbeitPreliminary_testsNemohAQWA_Check> pip install capytaine
Collecting capytaine
  Using cached capytaine-1.4.tar.gz (124 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:usersdodobappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from capytaine) (1.23.2)
.
.
.

Building wheels for collected packages: capytaine
  Building wheel for capytaine (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [213 lines of output]
      C:UsersdodobAppDataLocalTemppip-install-46g3rmyacapytaine_cc3bdd35637b4ed48d97c88363dfe438setup.py:9: 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
      
      
        from numpy.distutils.core import Extension, setup
      running bdist_wheel
.
.
.

 -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude /Tcbuildsrc.win-amd64-3.9capytainegreen_functionsDelhommeau_f90module.c /Fobuildtemp.win-amd64-cpython-39Releasebuildsrc.win-amd64-3.9capytainegreen_functionsDelhommeau_f90module.obj -O2 -fopenmp -cpp
      cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
      cl : Command line warning D9002 : ignoring unknown option '-cpp'
      Delhommeau_f90module.c
      C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0includepyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
      error: Command "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629binHostX86x64cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ibuildsrc.win-amd64-3.9buildsrc.win-amd64-3.9capytainegreen_functions -IC:UsersdodobAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39site-packagesnumpycoreinclude -Ibuildsrc.win-amd64-3.9numpydistutilsinclude -IC:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0include -IC:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0Include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.316"
.
.
.

  INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:UsersdodobAppDataLocalTemppip-install-46g3rmyacapytaine_cc3bdd35637b4ed48d97c88363dfe438buildtemp.win-amd64-cpython-39Releaseccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for capytaine
  Running setup.py clean for capytaine
Failed to build capytaine
Installing collected packages: capytaine
  Running setup.py install for capytaine ... error
  error: subprocess-exited-with-error

  × Running setup.py install for capytaine did not run successfully.
  │ exit code: 1
  ╰─> [200 lines of output]
      C:UsersdodobAppDataLocalTemppip-install-46g3rmyacapytaine_cc3bdd35637b4ed48d97c88363dfe438setup.py:9: 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
     
     
        from numpy.distutils.core import Extension, setup
      running install
      C:UsersdodobAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39site-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
.
.
.

 creating C:UsersdodobAppDataLocalTemptmpv6hwqlsfUsersdodobAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39site-packagesnumpydistutilschecks
      INFO: CCompilerOpt.cc_test_flags[1073] : testing flags (/WX)
      WARN: CCompilerOpt.__init__[1240] : feature 'AVX512_KNL' is disabled, MSVC compiler doesn't support it
      WARN: CCompilerOpt.__init__[1240] : feature 'AVX512_KNM' is disabled, MSVC compiler doesn't support it
      INFO: CCompilerOpt.__init__[1782] : check requested baseline
.
.
.

  C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0includepyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
      error: Command "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629binHostX86x64cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ibuildsrc.win-amd64-3.9buildsrc.win-amd64-3.9capytainegreen_functions -IC:UsersdodobAppDataLocalPackagesPythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0LocalCachelocal-packagesPython39site-packagesnumpycoreinclude -Ibuildsrc.win-amd64-3.9numpydistutilsinclude -IC:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0include -IC:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0Include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.33.31629include -IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude /Tcbuildsrc.win-amd64-3.9capytainegreen_functionsDelhommeau_f90module.c /Fobuildtemp.win-amd64-cpython-39Releasebuildsrc.win-amd64-3.9capytainegreen_functionsDelhommeau_f90module.obj -O2 -fopenmp -cpp" failed with exit status 2
      INFO:
      ########### EXT COMPILER OPTIMIZATION ###########
      INFO: Platform      :
        Architecture: x64
        Compiler    : msvc
     
      CPU baseline  :
        Requested   : 'min'
        Enabled     : none
        Flags       : none
        Extra checks: none
     
      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : none
        Generated   : none
      INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:UsersdodobAppDataLocalTemppip-install-46g3rmyacapytaine_cc3bdd35637b4ed48d97c88363dfe438buildtemp.win-amd64-cpython-39Releaseccompiler_opt_cache_ext.py
      [end of output]

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

× Encountered error while trying to install package.
╰─> capytaine

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

3

Answers


  1. This is very likely a conflict of package versions. Try running pip list, copying all of your packages, creating a new file called requirements.txt, putting all of your packages in there (without versions) and running pip install -r requirements.txt. This will tell pip to solve the version conflict and you’ll get a more readable error in the worst case scenario.

    Login or Signup to reply.
  2. One way is If you install a new version of python make sure you have added the path into the System environment variable of windows.

    The second one is In VS code you need to add a Python Interpreter to run a pip command.

    a. CTRL+SHIFT+P to open Command Palette.
    b. Type & Select Python Interpreter in Command Palette.

    The third way is to create a virtual environment and activate it in your project and run any types of pip command you want to install.
    For that see the
    link 1 (https://code.visualstudio.com/docs/python/environments)
    Link 2 (https://docs.python.org/3/tutorial/venv.html)

    Login or Signup to reply.
  3. According to the docs.

    This package can only be installed by Conda package manager by the following codes:

    conda install -c conda-forge capytaine
    

    You need to create an conda environment then install this package.

    The Python extension automatically detects existing conda environments. We recommend you install a Python interpreter into your conda environment, otherwise one will be installed for you after you select the environment. For example, the following command creates a conda environment with the Python 3.9 interpreter and several libraries, which VS Code then shows in the list of available interpreters:

    conda create -n env-01 python=3.9 scipy=0.15.0 astroid babel
    

    You can refer to docs for more details to create a conda environment.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search