Qiulin Ren
Qiulin Ren

Reputation: 13

problem of installing xfoil python package

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:\users\xxx\desktop\curve\venv\lib\site-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:\Users\xxx\Desktop\curve\venv\lib\site-packages\setuptools\_distutils\dist.py:275: UserWarning: Unknown distribution option: 'zip_save'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\model.py -> build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\test.py -> build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\xfoil.py -> build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\__init__.py -> build\lib.win-amd64-cpython-310\xfoil
      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:\Users\xxx\Desktop\curve\venv\lib\site-packages\setuptools\_distutils\dist.py:275: UserWarning: Unknown distribution option: 'zip_save'
        warnings.warn(msg)
      running install
      C:\Users\xxx\Desktop\curve\venv\lib\site-packages\setuptools\command\install.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 build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\model.py -> build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\test.py -> build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\xfoil.py -> build\lib.win-amd64-cpython-310\xfoil
      copying xfoil\__init__.py -> build\lib.win-amd64-cpython-310\xfoil
      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

Upvotes: 1

Views: 1538

Answers (2)

LC297
LC297

Reputation: 3

I had the same problem, but it as been easily solved by reading the page linked by Joe (https://pypi.org/project/xfoil/). Just download the file from the Pypi mirror, unpack and install using pip in the directory:

pip install .

My problems was most probably linked to my python version... Thanks !

Upvotes: 0

Joe Heffer
Joe Heffer

Reputation: 36

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:\users\joe\miniconda3\envs\xfoil\lib\site-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"

Upvotes: 2

Related Questions