pangyou123456 2024-04-23 10:04 采纳率: 16.7%
浏览 42

pip install python-ESL安装失败

unbentu pip install python-ESL安装失败,更换多个版本也不能安装成功,如何解决

pangyou@pangyou-HP-EliteDesk-880-G1-TWR:~$ pip install swig
Defaulting to user installation because normal site-packages is not writeable
Collecting swig
  Using cached swig-4.2.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.9 MB)
Installing collected packages: swig
  WARNING: The scripts swig and swig4.0 are installed in '/home/pangyou/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed swig-4.2.1
pangyou@pangyou-HP-EliteDesk-880-G1-TWR:~$ pip install python-ESL
Defaulting to user installation because normal site-packages is not writeable
Collecting python-ESL
  Using cached python-ESL-1.4.18.tar.gz (40 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: python-ESL
  Building wheel for python-ESL (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      copying ESL.py -> build/lib.linux-x86_64-3.10
      running build_ext
      building '_ESL' extension
      swigging ESL.i to ESL_wrap.cpp
      swig -python -classic -c++ -DMULTIPLICITY -threads -I. -o ESL_wrap.cpp ESL.i
      Deprecated command line option: -classic. This option is no longer supported.
      error: command '/usr/bin/swig' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-ESL
  Running setup.py clean for python-ESL
Failed to build python-ESL
Installing collected packages: python-ESL
  Running setup.py install for python-ESL ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for python-ESL did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running install
      /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      copying ESL.py -> build/lib.linux-x86_64-3.10
      running build_ext
      building '_ESL' extension
      swigging ESL.i to ESL_wrap.cpp
      swig -python -classic -c++ -DMULTIPLICITY -threads -I. -o ESL_wrap.cpp ESL.i
      Deprecated command line option: -classic. This option is no longer supported.
      error: command '/usr/bin/swig' failed with exit code 1
      [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.
╰─> python-ESL

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
pangyou@pangyou-HP-EliteDesk-880-G1-TWR:~$ 

  • 写回答

5条回答 默认 最新

  • 专家-赤兔[在线] 全栈领域优质创作者 2024-04-23 10:04
    关注

    引自免费微信小程序:皆我百晓生

    根据您提供的错误信息,安装python-ESL时遇到了问题,主要是由于swig命令失败,这可能是由于SWIG版本不兼容或者缺少必要的依赖项。首先,让我们尝试更新您的Python环境中的SWIG到最新版本,并确保所有必需的构建工具已安装。

    在Ubuntu/Debian系统上,可以尝试以下步骤:

    1. 更新系统包:

      sudo apt-get update
      sudo apt-get upgrade
      
    2. 安装SWIG和必要的构建工具:

      sudo apt-get install build-essential libssl-dev swig
      
    3. 确保Python开发库也已安装,以便编译C扩展:

      sudo apt-get install python3-dev python3-setuptools python3-wheel
      
    4. 尝试重新安装python-ESL

      pip install python-ESL
      

    如果您是在其他Linux发行版或Windows上遇到问题,请根据相应的操作系统安装SWIG和构建工具。

    如果您仍然遇到问题,可能是因为python-ESL与当前的Python版本或系统的配置不兼容。在这种情况下,您可以尝试在一个虚拟环境中安装,以隔离环境变量和依赖关系:

    1. 首先,确保您已经安装了Python的虚拟环境管理器(例如:virtualenvconda)。如果没有,请安装一个。

    2. 创建一个新的虚拟环境并激活它:

      python3 -m venv myenv
      source myenv/bin/activate # 对于基于bash的shell
      conda create -n myenv python=3.x # 如果使用conda,替换x为所需的Python版本,然后运行
      conda activate myenv
      
    3. 在新环境中安装python-ESL

      pip install python-ESL
      

    这样应该能解决安装问题。如果还有任何问题,可能需要联系python-ESL的维护者或查看其文档,以获取更具体的安装指导。

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 4月23日

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀