issues when buidling python3.* on centos 7

joseph pareti joepareti54 at gmail.com
Sun Mar 25 12:15:09 EDT 2018


I have a VM in the cloud running centos that comes with python 2.7
installed on it. For my purpose, I need python 3.5 (or 6?)

However there is an issue with urlgrabber, and I  believe this is due to
inconsistencies with the 2 python versions, whcih I am not able to resolve.

DETAILS

INSTALL PYTHON 3 from scratch
https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7

change /usr/bin/yum because yum does not support python 3 so force it to
use python 2 in first line, else you get this:
except KeyboardInterrupt, e:

edits in  /usr/libexec/urlgrabber-ext-down to remove syntax errors


sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
[joepareti54 at xxx ~]$ sudo yum -y install python36u
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * epel: ftp.nluug.nl
 * ius: mirror.amsiohosting.net
Traceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
    from urlgrabber.grabber import \
ModuleNotFoundError: No module named 'urlgrabber'


Exiting on user cancel
[joepareti54 at xxx ~]$

therefore

wget
http://mirror.centos.org/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

sudo yum install python-urlgrabber-3.10-8.el7.noarch.rpm

now rerun sudo yum -y install python36u

basically same as here https://www.centos.org/forums/viewtopic.php?t=52325

the urlgrabber is not found

The following may give a clue because of inconsistent python versions:

[joepareti54 at xxx ~]$ python -V
Python 3.5.2 :: Anaconda 4.3.0 (64-bit)

[joepareti54 at xxx ~]$ rpm -ql python-urlgrabber | xargs -i dirname '{}' |
sort | uniq | grep site-packages

/usr/lib/python2.7/site-packages
/usr/lib/python2.7/site-packages/urlgrabber
[joepareti54 at xxx ~]$

so the install of python-urlgrabber-3.10-8.el7.noarch.rpm landed in the
wrong place as suggested here
https://forums.fedoraforum.org/showthread.php?95680-yum-broken-(-quot-No-module-named-urlgrabber-quot-)
and the inconsistency explains why the grabber module is not found



More information about the Python-list mailing list