- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Linux/CentOS 的新手,使用起来不是很有趣。当我在服务器上运行它时,我正在使用 python 2.7 在我的 Mac 上本地开发一些东西我遇到了一些问题,我认为这是 Python 的过时版本(2.4.3)然后我更新了它,这不是一个很好的主意。我从源代码构建它然后遇到问题,Yum 和其他模块消失了。
我没有回来使用 Python 2.4.3,但我仍然没有回来使用 Yum。
[root@issues ~]# yum Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:]
'import site' failed; use -v for traceback There was a problem importing one of the Python modules required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or verify that the module is installed correctly.
It's possible that the above module doesn't match the current version of Python, which is: 2.4.3 (#1, Jun 18 2012, 08:55:31) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]
If you cannot solve this problem yourself, please go to the yum faq at: http://wiki.linux.duke.edu/YumFaq
搜了一大堆论坛都说是因为Python版本不同,我现在不是这样了,我觉得是Yum映射到不同的目录有关。
我在其他地方找到了这个命令并运行了这个:
[root@issues ~]# rpm -V python
missing /usr/bin/python2
missing /usr/bin/python2.4
有谁知道该做什么或去哪里寻求帮助?我真的需要尽快解决这个问题!
谢谢
实际上只是补充一下,如果我运行 python,我会得到这个输出。
[root@issues ~]# python
Could not find platform independent libraries
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
'import site' failed; use -v for traceback
Python 2.4.3 (#1, Jun 18 2012, 08:55:31)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>
最佳答案
是的,在 Linux 系统上,升级 2.4.x 版本的默认 python 不是一个好主意,Linux 包管理和许多其他工具需要它才能正常运行。最好单独安装其他python版本并直接使用它(如:/usr/bin/python2.7)
Python 可执行文件本身无法正常工作,因为它无法在启动期间加载默认模块“站点”。
python 安装失败。
由于您不能使用“Yum”或“RPM”来引导您的软件包,我建议您使用您的“操作系统”安装光盘或 ISO 镜像直接安装 rpm/yum 软件包。它会将 python 安装修复为依赖项。
我已经解决了这个问题,经过各种试验后,这是我唯一可以解决的方法。
[编辑:]
参见:Python 2.x multiple version issues regarding PYTHONPATH
同样的错误是找不到包目录。
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
查看我拥有的路径。查看包的路径,是否可以设置“PYTHONHOME”。
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib64/python2.4/site.pyc matches /usr/lib64/python2.4/site.py
import site # precompiled from /usr/lib64/python2.4/site.pyc
# /usr/lib64/python2.4/os.pyc matches /usr/lib64/python2.4/os.py
import os # precompiled from /usr/lib64/python2.4/os.pyc
如果找不到类似的包位置,能不能用RPM直接重新安装python2.4
rpm --force -hUv url_for_python_rpm
关于Python 和 Yum 发布 CentOS 5.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11171015/
使用 yum 的优先级插件时,会显示已排除的软件包数量。有没有办法显示这些包的名称? 最佳答案 你总是可以像这样运行 yum: yum -d 9 install foo 并且部分日志输出是排除包。 编
我尝试使用命令 make && make install 安装 yum-3.4.3,但失败并显示以下日志: infra-bld4:/tmp/hxu2/yum-3.4.3> make for d in
我在 CentOs 8 上运行以下命令 $ cat /etc/redhat-release CentOS Linux release 8.2.2004 (Core) 我从一个干净且更新的 yum 数据
我知道 FI-WARE 在 http://repositories.testbed.fiware.org/ 提供了一个公共(public) yum 存储库可用于安装 FI-WARE 软件包,例如 Or
如何将 yum 存储库完全导入 Artifactory? 请注意,我指的是外部 yum存储库,并且由于在 Artifactory 中实现外部存储库镜像的方式,我无法使用 artifactory-rem
当我在 shell 中使用 yum 时,错误消息是没有名为 yum 的模块,所以我编辑/usr/bin/yum 将第一行更改为另一个版本的 python,但没有任何变化,当我使用不同的 python
我正在按照可以在此处找到的教程在 ec2 实例上设置 headless Selenium 刮刀: https://krbnite.github.io/Driving-Headless-Chrome-w
我们在我们公司使用自定义的 yum 存储库。某些事情导致他们失败 yum makecache命令。 我在 CentOS Linux release 7.7.1908 (Core) . 这是我们在运行
我正在尝试使用 RPM 升级软件包。我如何知道它是全新安装还是更新。是否有任何我可以检查的标志,或者我应该编写一个脚本来检查它是全新安装还是升级? 最佳答案 如果我很好地理解你的问题;我想你自己打包
在 Debian 衍生版中,在使用 apt-get install xxx 从 apt 安装软件之前,需要运行apt-get update .这会刷新包列表,以便正确解析依赖项等。 在使用 RHEL
我正在编写一个更新本地存储库 URL 的 yum 插件。当 repo URL 更改时,我想让 yum 运行 yum clean all 以确保没有缓存过时的信息。我知道当 yum clean [plu
许多 makefile 使用 pkg-config,但名称与包管理器无关(例如 yum/apt)。如何将 pkg-config 名称映射到它们?有什么窍门吗? 示例:如果我执行 yum searchN
我对 Linux 和 VDS 完全陌生。 VDS的操作系统是CentOS 6.9。我正在尝试安装apache、邮件服务器、php、mysql等。但我认为,要能够安装这些 'yum update' 或
当我执行 yum 时,像这样搜索 mysql-libs: $sudo yum search mysql-libs Loaded plugins: branch, downloadonly, faste
我在 CentOS 上使用 MySQL-Server。我 'yum remove' MySQL 服务器,然后再次 'yum install' 它。当我尝试使用 'mysqladmin' 为 'root
我见过两种安装包的方式,比如CentOS上的squid: 1.yum -y install squid 2.yum install squid 谁能告诉我它们之间有什么区别?另外,我使用的是 Cent
提示我出现以下错误 不匹配参数:python-devel 最佳答案 python2.7现在已经完全过时了。你应该和 python3 一起工作.因此你可以安装: dnf install python3-
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
尝试从任何存储库更新任何包时,很难找到导致以下错误的原因。我通过将所有其他人设置为禁用来测试多个 repo 协议(protocol)。我已经清理了所有缓存并删除了所有 dnf yum 缓存文件。 #
我已经在我的 VMServer 上部署了一个新的 CentOS 6.5 实例,其中安装了开发工具、X11 和其他几个软件包。第一天,似乎一切正常。后来我无法使用 yum 安装程序来更新或安装任何软件包
我是一名优秀的程序员,十分优秀!