安装xfoil python包的问题



我在安装xfoil python包时遇到了问题收集xfoil使用缓存xfoil-1.1.1.tar.gz (12 kB)准备元数据(setup.py)…完成要求已经满足:numpy在c:usersxxxdesktopcurvevenvlibsite-packages (from xfoil) (1.22.4)为收集的包裹建造轮子:xfoil为xfoil构建轮子(setup.py)…错误错误: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.

我该怎么处理呢?非常感谢

问题似乎是构建过程失败了,因为pip试图编译源代码,但它失败了,因为这个过程的先决条件不存在。

要使此工作,您可以使用预编译(构建)包安装包。该包只发布了Python 3.7的构建包https://pypi.org/project/xfoil/文件

要使用此功能,请创建一个使用Python 3.7版本的Python虚拟环境。

我使用如下Anaconda Python发行版实现了这个工作。

首先,使用Python 3.7

创建一个虚拟环境
conda create -n xfoil python=3.7
pip install xfoil

由于此环境使用的是Python 3.7版本,因此将下载构建的xfoil发行版(wheel文件.whl)。控制台输出如下所示:

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

如果您想使用最新的Python版本(您使用的是3.10版本)构建xfoil,请按照xfoil页面https://pypi.org/project/xfoil/上的"构建和安装Python模块">

下的构建说明进行构建。

我也遇到过同样的问题,但是通过阅读Joe链接的页面(https://pypi.org/project/xfoil/)很容易解决这个问题。只需从Pypi镜像中下载文件,在目录

中解压缩并使用pip安装。
pip install .

我的问题很可能与我的python版本有关…谢谢!

最新更新