时间戳转换器

unix 的 psutil pip 安装问题

日期:2023-02-15     浏览:493    
【中文标题】unix 的 psutil pip 安装问题【英文标题】:psutil pip installation issue for unix 【发布时间】:2022-01-08 10:09:55 【问题描述】:

如何重现问题:

进入 unix 创建虚拟环境:python3 -m venv venv_dummy 进入虚拟环境:source venv_dummy/bin/activate 点安装psutil:pip install psutil

主机信息:

unix 类内核 (Linux Mariner)。更多信息:https://github.com/microsoft/CBL-Mariner pip 版本:21.3.1 Python 版本:3.7.10

错误:

   ```
  Running setup.py install for psutil ... error
ERROR: Command errored out with exit status 1:
 command: /home/ddummy/venv_dummy/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f428vle2/psutil_c32bd82932444031aaff9983e3255a51/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f428vle2/psutil_c32bd82932444031aaff9983e3255a51/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-z3uzjnld/install-record.txt --single-version-externally-managed --compile --install-headers /home/ddummy/venv_dummy/include/site/python3.7/psutil
     cwd: /tmp/pip-install-f428vle2/psutil_c32bd82932444031aaff9983e3255a51/
Complete output (46 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.7
creating build/lib.linux-aarch64-3.7/psutil
copying psutil/_psosx.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_pssunos.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_psaix.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/__init__.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_psposix.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_common.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_compat.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-aarch64-3.7/psutil
copying psutil/_pswindows.py -> build/lib.linux-aarch64-3.7/psutil
creating build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-aarch64-3.7/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-3.7/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-aarch64-3.7
creating build/temp.linux-aarch64-3.7/psutil
aarch64-unknown-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -I/home/ddummy/venv_dummy/include -I/usr/include/python3.7m -c psutil/_psutil_common.c -o build/temp.linux-aarch64-3.7/psutil/_psutil_common.o
aarch64-unknown-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -I/home/ddummy/venv_dummy/include -I/usr/include/python3.7m -c psutil/_psutil_posix.c -o build/temp.linux-aarch64-3.7/psutil/_psutil_posix.o
aarch64-unknown-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/mariner/default-hardened-cc1 -fasynchronous-unwind-tables -fstack-***-protection -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -I/home/ddummy/venv_dummy/include -I/usr/include/python3.7m -c psutil/_psutil_linux.c -o build/temp.linux-aarch64-3.7/psutil/_psutil_linux.o
aarch64-unknown-linux-gnu-gcc -pthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/mariner/default-hardened-ld -Wl,-dT,/usr/src/mariner/BUILD/module_info.ld -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/mariner/default-hardened-ld -Wl,-dT,/usr/src/mariner/BUILD/module_info.ld build/temp.linux-aarch64-3.7/psutil/_psutil_common.o build/temp.linux-aarch64-3.7/psutil/_psutil_posix.o build/temp.linux-aarch64-3.7/psutil/_psutil_linux.o -L/usr/lib -lpython3.7m -o build/lib.linux-aarch64-3.7/psutil/_psutil_linux.cpython-37m-aarch64-linux-gnu.so
/usr/bin/ld: cannot open linker script file /usr/src/mariner/BUILD/module_info.ld: No such file or directory
collect2: error: ld returned 1 exit status
error: command 'aarch64-unknown-linux-gnu-gcc' failed with exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: /home/ddummy/venv_dummy/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f428vle2/psutil_c32bd82932444031aaff9983e3255a51/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f428vle2/psutil_c32bd82932444031aaff9983e3255a51/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-z3uzjnld/install-record.txt --single-version-externally-managed --compile --install-headers /home/ddummy/venv_dummy/include/site/python3.7/psutil Check the logs for full command output.

到目前为止的研究和完成的事情:

本次讨论中遵循的指令:https://github.com/giampaolo/psutil/issues/1143 检查python3-devel 是否已正确安装在系统中
> sudo yum search python3 | grep -i dev
python3-devel : The libraries and header files needed for Python development.
python3-py : Python development support library
python3-devel : The libraries and header files needed for Python development.
python3-py : Python development support library
python3-tools : A collection of development tools included with Python.
python3-devel : The libraries and header files needed for Python development.
python3-devel : The libraries and header files needed for Python development.
python3-devel : The libraries and header files needed for Python development.
python3-devel : The libraries and header files needed for Python development.
python3-devel : The libraries and header files needed for Python development.
python3-devel : The libraries and header files needed for Python development.
python3-devel : The libraries and header files needed for Python development.
python3-py : Python development support library
python3-rbd : Python 3 libraries for the RADOS block device
python3-rbd : Python 3 libraries for the RADOS block device
python3-rbd : Python 3 libraries for the RADOS block device
python3-tools : A collection of development tools included with Python.
python3-tools : A collection of development tools included with Python.
python3-tools : A collection of development tools included with Python.
python3-tools : A collection of development tools included with Python.
python3-tools : A collection of development tools included with Python.
python3-tools : A collection of development tools included with Python.
python3-tools : A collection of development tools included with Python.
python3-pybind11 : Development headers for pybind11

尝试安装以下内容但未成功:
> sudo yum install python36-devel.x86_64
No package python36-devel.x86_64 available
尝试安装以下但未成功:
> sudo yum install python3.7-dev
No package python3.7-dev available
尝试以下:
>sudo yum install -y gcc gcc-c++ libgcc platform-python-devel
Package gcc is already installed.
Package libgcc is already installed.
No package gcc-c++ available
No package platform-python-devel available
Error(1011) : No matching packages

【问题讨论】:

【参考方案1】:

经过大量研究,我发现了问题所在。当我运行以下操作时,安装工作正常:

sudo venv_dummy/bin/pip3 install psutil 

已经被dlitster在帖子https://github.com/giampaolo/psutil/issues/1143讨论过

【讨论】:

相关文章

Plotly.io 没有看到 psutil 包,即使它已安装

{】Plotly.io没有看到psutil包,即使它已安装【英文标题】:Plotly.iodoesn\'tseethepsutilpackageeventhoughit\'sinstalled【发布时间】:2020-03-1608:02:56【问题描述】:我正在尝试执行以下代码:importnumpyasnpimportpandasaspdimportmatplotlib.pyplotaspltimportmatp...}

通过 pip (PyPI) 安装 Python 实时依赖项 [重复]

{】通过pip(PyPI)安装Python实时依赖项[重复]【英文标题】:Pythonlivedependencyinstallationviapip(PyPI)[duplicate]【发布时间】:2014-10-0611:58:12【问题描述】:我想提取一个包的实时版本作为我使用pip安装的另一个包的依赖项。现在,我已经找...}

运维自动化之psutil模块(代码片段)

{psutil是一个跨平台的库,能够轻松实现获取系统运行的进程和系统利用例(CPU,磁盘,内存,网络等)信息,主要运用于系统监控,分析系统资源和进程管理。psutil比在shell中使用一连串的命令(ps,top,lsof,df,who,ionice,iostat等)命令...}

Heroku for Django 应用程序的条件 pip 安装要求

{】HerokuforDjango应用程序的条件pip安装要求【英文标题】:ConditionalpipinstallrequirementsonHerokuforDjangoapp【发布时间】:2012-08-1805:22:54【问题描述】:首先让我说,我不认为有办法做到这一点......但是,那里有很多聪明的人,所以我想...}

python 3.9.0(64位)和pip版本20.2.3中的tensorflow安装。?

{】python3.9.0(64位)和pip版本20.2.3中的tensorflow安装。?【英文标题】:tensorflowinstallationinpython3.9.0(64bit)andpipversion20.2.3.?【发布时间】:2021-02-1317:50:53【问题描述】:我想安装TensorFlow,从重新安装到尝试不同版本,我都试过了,但...}

运行 pip 安装:确认 ssl 证书时出现问题:[SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败 [重复]

{】运行pip安装:确认ssl证书时出现问题:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败[重复]【英文标题】:RUNpipinstall:Therewasaproblemconfirmingthesslcertificate:[SSL:CERTIFICATE_VERIFY_FAILED]certificateverifyfailed[duplicate]【发布时间】:2019-10-0113:19:21【...}

系统性能信息模块之psutil模块(代码片段)

{一、psutil模块介绍官方网址:https://pypi.org/psutil模块安装:https://github.com/giampaolo/psutil/blob/master/INSTALL.rst官方介绍:https://pypi.org/project/psutil/#downloads 概要plutil(进程和系统实用程序)是一个跨平台的库,用于在Python中检索有关运}

python之psutil模块

{About psutil(python系统和流程实用程序)是一个跨平台库,用于在Python中检索有关正在运行的 进程和系统利用率(CPU,内存,磁盘,网络,传感器)的信息。它主要用于系统监视,分析,限制进程资源和运行进程的管理。...}

如何在 Windows 上的 Python 2.7 上安装 Tensorflow?

{】如何在Windows上的Python2.7上安装Tensorflow?【英文标题】:HowtoinstallTensorflowonPython2.7onWindows?【发布时间】:2018-01-0103:55:10【问题描述】:我尝试通过pip(pipinstalltensorflow)安装TensorFlow,但收到此错误找不到满足tensorflow要求的版本(...}

系统性能信息模块psutil(代码片段)

{...5811281984>或python自动化运维技术与最佳实践安装pipinstallpsutil使用导入模块importpsutil查看内存#查看内存状态mem=psutil.virtual_memory()#单位}

Copyright ©2021 时间戳转换器 小常识 114pp | 陕ICP备18005036号