当前位置: 首页 > news >正文

解决linux下安装apex库报错:ModuleNotFoundError: No module named ‘packaging‘

使用如下命令安装apex:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

报错:

Running command python setup.py egg_infoTraceback (most recent call last):File "<string>", line 2, in <module>File "<pip-setuptools-caller>", line 34, in <module>File "/home/glm/apex/setup.py", line 4, in <module>from packaging.version import parse, VersionModuleNotFoundError: No module named 'packaging'error: subprocess-exited-with-error× python setup.py egg_info did not run successfully.│ exit code: 1╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.full command: /home/letrain/miniconda/envs/glm/bin/python -c 'exec(compile('"'"''"'"''"'"'# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py## - It imports setuptools before invoking setup.py, to enable projects that directly#   import from `distutils.core` to work with newer packaging standards.# - It provides a clear error message when setuptools is not installed.# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:#     manifest_maker: standard file '"'"'-c'"'"' not found".# - It generates a shim setup.py, for handling setup.cfg-only projects.import os, sys, tokenizetry:import setuptoolsexcept ImportError as error:print("ERROR: Can not execute `setup.py` since setuptools is not available in ""the build environment.",file=sys.stderr,)sys.exit(1)__file__ = %rsys.argv[0] = __file__if os.path.exists(__file__):filename = __file__with tokenize.open(__file__) as f:setup_py_code = f.read()else:filename = "<auto-generated setuptools caller>"setup_py_code = "from setuptools import setup; setup()"exec(compile(setup_py_code, filename, "exec"))'"'"''"'"''"'"' % ('"'"'/home/glm/apex/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-pijoox9ccwd: /home/glm/apex/Preparing metadata (setup.py) ... error
error: metadata-generation-failed× Encountered error while generating package metadata.
╰─> See above for output.note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

在安装命令中加入--no-build-isolation,使用如下命令:

pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --no-build-isolation ./

即可安装成功

http://www.lryc.cn/news/373914.html

相关文章:

  • React基础教程(07):条件渲染
  • 回归预测 | Matlab实现NGO-HKELM北方苍鹰算法优化混合核极限学习机多变量回归预测
  • 操作系统——信号
  • 力扣1482.制作m束花所需的最少时间
  • 解决 Linux 和 Java 1.8 中上传中文名称图片报错问题
  • cocos开发的时候 wx.onShow在vscode里面显示红色
  • 使用 PNPM 从零搭建 Monorepo,测试组件并发布
  • Oracle 19C 数据库表被误删除的模拟恢复
  • 【CICID】GitHub-Actions语法
  • Ionic 创建 APP
  • 【数学代码】幂
  • os.system() 函数
  • Spring Boot中的RESTful API详细介绍及使用
  • nlp学习笔记
  • 使用python获取内存信息
  • 外包公司泛滥,这些常识你应该提前知道?
  • Linux下的抓包工具使用介绍
  • centos环境上:k8s 简单安装教程
  • 短视频矩阵系统/源码搭建---拆解热门视频功能开发上线
  • 手机和模拟器的 Frida 环境配置
  • 力扣1385.两个数组间的距离值
  • [C++] 小游戏 斗破苍穹 2.11.6 版本 zty出品
  • 认识与学习JSP
  • MySql 各种 join
  • 【Android面试八股文】Android中操作多线程的方式有哪些?
  • 语义分割和目标检测的关系
  • SpringBoot 大文件基于md5实现分片上传、断点续传、秒传
  • 数据资产治理与数据质量提升:构建完善的数据治理体系,确保数据资产的高质量与准确性
  • SylixOS下UDP组播测试程序
  • Web前端快速开发平台:革命性工具,提升开发效率的新篇章