I am trying to run a yum command # yum install mod-pagespeed but I am getting this error
There was a problem importing one of the Python modules required to
run yum. The error leading to this problem was:
cannot import name Repository
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.6.6 (r266:84292, Feb 22 2013, 00:00:18) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
If you cannot solve this problem yourself, please go to the yum faq
at: http://yum.baseurl.org/wiki/Faq
Your help will be greatly appreciated
Did you upgrade the Python that's running on your system? It's possible that it broke yum, as yum on older systems relied on the Python version being 2.4
Can you downgrade python back to 2.4 to get yum working again, then do an alternate install of Python to a newer version, keeping both on your system?
See this link for procedures for installing alternate versions of python:
https://github.com/h2oai/h2o-2/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only
Related
I need to use Python 2.7 for my project. But after installing Python, I can't use the module yum. I have this error :
[root#nexus-chat2 .synapse]# yum
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.7.5 (default, Feb 19 2018, 14:55:04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
Do you know how can I fix that ? I use CentOS 6
The yum module is not a stock Python module. It would need to be built and installed explicitly for any version of Python you install on your system. With CentOS 6, the system Python is python 2.6 (and the yum module will be available by default).
If you wanted to make the yum module available to your Python 2.7 install, you would need to build yum against your Python 2.7 install, which may be a non-trivial task.
The simplest solutions are (a) just use Python 2.6 or (b) upgrade to a more recent distribution.
I was trying to configure the RBTools on mac os but i am facing an issue with setting up the repo.
This is the error am getting.
ImportError: Python minor version mismatch: The Mercurial extension modules were compiled with Python 2.7.5, but Mercurial is currently using Python with sys.hexversion=33949936: Python 2.6.8 (unknown, Mar 9 2014, 22:16:00) \n', '[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]\n', ' at: /usr/bin/python\n'
I have installed RBTools v0.7.4 with python version 2.6.8 and i have python version 2.7.5 as well.
This is the complete traceback http://pastie.org/10332044
Am getting this error when i try to run the rbt setup-repo.
Any help on this would be of great help am struck with this from past one week.
I think this is a bug in the RBTools assembly. I filed this ticket for it. See more details on how I troubleshot there, but specifically, go look at /usr/local/bin/rbt and change the shebang from python2.6 to python and you should be good.
How do I resolve this error. Can anyone help to find this?
sudo yum groupinstall -y 'development tools'
Got following error:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib/librpm.so.3: undefined symbol: selinux_status_close
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.6.9 (unknown, Sep 13 2014, 00:25:13)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
I'm new to Linux/CentOS and I'm not having the most fun using it. I was developing something locally on my Mac using python 2.7 when I ran it on the server I ran into issues which I put down to being the outdated version of Python (2.4.3) I then updated it, which wasn't a very good idea. I built it from source and then ran into issues, Yum and other modules disappeared.
I'm not back using Python 2.4.3 but I still don't have Yum back.
[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
Searching loads of forums everyone says that it's because of a different version of Python, this is no longer the case for me, I think it's something to do with Yum being mapped to a different directory.
I found this command somewhere else and ran this:
[root#issues ~]# rpm -V python
missing /usr/bin/python2
missing /usr/bin/python2.4
Does anyone know what to do or where to go for help? I really need to get this fixed as soon as possible!
Thanks
Actually just to add, If I run python I get this output.
[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.
>
Yes on Linux systems, it is not a good idea to upgrade default python which is 2.4.x version and Linux package management and many other tools require it to function correctly. It is always better to install other python versions separately and use it directly (like: /usr/bin/python2.7)
Python executable itself is not working correctly as it is not able to load default module 'site' during start-up.
The python installation is broken.
Since you can not use "Yum" or "RPM" to bootstrap your packages, I suggest that you use your "OS" installation CD or ISO image to install the rpm/yum packages directly. It will fix the python installation as dependency.
I had gone through this issue and after various trial, this was only way I could fix it.
[Edit:]
See: Python 2.x multiple version issues regarding PYTHONPATH
Also the error is that it is not able to find the package directory.
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
See the paths that I have. Check out the path of packages and can you set "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
If you are not able to locate similar package location, can you use RPM to directly install python2.4 again
rpm --force -hUv url_for_python_rpm
I cannot find any information regarding the issue I am having so here it is.
While trying to yum install php-pear (infact running yum at all) I run into this problem:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
cannot import name canCoinstall
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, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
And as it says above - something to do with the module canCoinstall. Does anyone know how I can fix this?
change your python version in yum to lower,
such as:/etc/bin/yum
change
#!/usr/bin/python
to
#!/usr/bin/python2.4