[Yum-devel] wrong python version (was: Re: [Yum] yum 2.2.0 vs RHL 9)

Terrel Shumway terrel at gmail.com
Fri Feb 25 20:20:05 UTC 2005


Just a suggestion to reduce/eliminate this FAQ

make /usr/bin/yum print out a helpful message if the import fails:
-----------------
#!/usr/bin/python
import sys
try:
   import yum
except ImportError:
   print sys.stderr >> "The yum libraries do not seem to be available
on your system for this version of python ", sys.version
   print sys.stderr >> "Please make sure the RPM you used to install
yum was built for your distribution (e.g. by building it yourself from
a source RPM)"
   sys.exit(1)

sys.path.insert(0, '/usr/share/yum-cli')
try:
    import yummain
    yummain.main(sys.argv[1:])
except KeyboardInterrupt, e:
    print >> sys.stderr, "\n\nExiting on user cancel."
    sys.exit(1)
-----------------



More information about the Yum-devel mailing list