LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   'No module named yum' error (https://www.linuxquestions.org/questions/linux-software-2/no-module-named-yum-error-4175604788/)

giulia26 04-27-2017 12:57 PM

'No module named yum' error
 
Hi,

Scientific Linux 6
If I try to use yum I get the following message:

'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.6.6 (r266:84292, Nov 21 2013, 12:39:37)
[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



I can fix that with 'unset PYTHONHOME'
but then when I try to run python from the terminal I get:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site



which python output:
/usr/local/canopy/bin/python

and PYTHONHOME is set to:
/usr/local/CanopyCore/appdata/canopy-1.1.0.1371.rh5-x86_64

I don't know what to do. Any suggestion?
Thanks!

John VV 04-27-2017 04:29 PM

did you by chance replace the DEFAULT!!! install of python

which python output:
/usr/local/canopy/bin/python

YOU DID , NOT GOOD

yum REQUIRES!!!! the version of python to be installed

the fix may or may not be easy if you did

and WHY are you trying to install a RHEL5 rpm on a rhel/cent/sl 6.9 install

most rhel5 things will NOT work on 6

you can manually extract the python rpm and manually " copy past" it into the correct places

SL 6.9 64 bit
http://ftp.scientificlinux.org/linux...4/os/Packages/
-- python-2.6.6-66.el6_8.x86_64.rpm --

giulia26 04-28-2017 10:17 PM

Thanks for your reply!
I don't know why there is a RHEL5 python and yes, python has been replaced. It's a shared computer and I can't really do about it. I tried logging in with a different user that uses the same python and does not have PYTHONHOME set and both yum and python work fine. I am not sure what to look at to figure out why...


All times are GMT -5. The time now is 07:42 AM.