I got a problem of installing xfoil python package Collecting xfoil Using cached xfoil-1.1.1.tar.gz (12 kB) Preparing metadata (setup.py) … done Requirement already satisfied: numpy in c:usersxxxdesktopcurvevenvlibsite-packages (from xfoil) (1.22.4) Building wheels for collected packages: xfoil Building wheel for xfoil (setup.py) … error error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [14 lines of output] C:UsersxxxDesktopcurvevenvlibsite-packagessetuptools_distutilsdist.py:275: UserWarning: Unknown distribution option: 'zip_save' warnings.warn(msg) running bdist_wheel running build running build_py creating build creating buildlib.win-amd64-cpython-310 creating buildlib.win-amd64-cpython-310xfoil copying xfoilmodel.py -> buildlib.win-amd64-cpython-310xfoil copying xfoiltest.py -> buildlib.win-amd64-cpython-310xfoil copying xfoilxfoil.py -> buildlib.win-amd64-cpython-310xfoil copying xfoil__init__.py -> buildlib.win-amd64-cpython-310xfoil running build_ext error: [WinError 2] system cannot find the file specified [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for xfoil Running setup.py clean for xfoil Failed to build xfoil Installing collected packages: xfoil Running setup.py install for xfoil ... error error: subprocess-exited-with-error × Running setup.py install for xfoil did not run successfully. │ exit code: 1 ╰─> [16 lines of output] C:UsersxxxDesktopcurvevenvlibsite-packagessetuptools_distutilsdist.py:275: UserWarning: Unknown distribution option: 'zip_save' warnings.warn(msg) running install C:UsersxxxDesktopcurvevenvlibsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build an d pip and other standards-based tools. warnings.warn( running build running build_py creating build creating buildlib.win-amd64-cpython-310 creating buildlib.win-amd64-cpython-310xfoil copying xfoilmodel.py -> buildlib.win-amd64-cpython-310xfoil copying xfoiltest.py -> buildlib.win-amd64-cpython-310xfoil copying xfoilxfoil.py -> buildlib.win-amd64-cpython-310xfoil copying xfoil__init__.py -> buildlib.win-amd64-cpython-310xfoil running build_ext error: [WinError 2] system cannot find the file specified [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. ╰─> xfoil note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
How can I deal with it? Thank you very much
Advertisement
Answer
The problem appears to be that the build process is failing, as pip is trying to compile the source code, but it’s failing because the prerequisites for this process aren’t present.
To make this work, you could install the package using pre-compiled (built) packages. The package has only published built packages for Python 3.7 https://pypi.org/project/xfoil/#files
To use this, create a Python virtual environment that uses Python version 3.7.
I got this working using the Anaconda Python distribution as follows.
First, create a virtual environment using Python version 3.7
conda create -n xfoil python=3.7 pip install xfoil
Because this environment is using Python version 3.7, the built xfoil distribution will be downloaded (the wheel file .whl). The console output is shown below:
Collecting xfoil Downloading xfoil-1.1.1-cp37-cp37m-win_amd64.whl (442 kB) |████████████████████████████████| 442 kB 1.6 MB/s Requirement already satisfied: numpy in c:usersjoeminiconda3envsxfoillibsite-packages (from xfoil) (1.19.5) Installing collected packages: xfoil Successfully installed xfoil-1.1.1
If you want to build xfoil using a more recent Python version (you’re using version 3.10) then follow the build instructions on the xfoil page https://pypi.org/project/xfoil/ under “Building and Installing the Python Module”