[New-bugs-announce] [issue46288] Migrating python 2.7 to 3.6 using 2to3 tool

Karthik S report at bugs.python.org
Fri Jan 7 02:27:16 EST 2022


New submission from Karthik S <mskarthik28 at gmail.com>:

Greeting of the day to all..

I would like to address few queries as mentioned in the below.

python 2.7 code is running fine on RHEL 7.9,we are migrating to python3 from Python2 using 2to3 on RHEL 7.9. 
After migrating, When we run our products in python 3.6,we are facing some modules are not imported error.

Example 1: 
    from IN import AF_INET6
ModuleNotFoundError: No module named 'IN'

In 2.7 IN modules coming from python-libs package,but in python3-libs doesnt find the IN module.
/usr/lib64/python2.7/plat-linux2/IN.py is avaialbe in python-libs-2.7.5-89.el7.x86_64 ,but it is not avilable in python3-libs.

[root at opt]# rpm -ql python-libs | grep -i IN.py
/usr/lib64/python2.7/plat-linux2/IN.py
/usr/lib64/python2.7/plat-linux2/IN.pyc
/usr/lib64/python2.7/plat-linux2/IN.pyo

[root@ opt]# rpm -ql python3-libs | grep -i IN.py
[root@ opt]#

Example2: 

    from yum import YumBase
ModuleNotFoundError: No module named 'yum'

In RHEL 7.9 python 2.7 /usr/lib/python2.7/site-packages/yum is avaialbe , but in RHEL 7.9 with python3 it is not available.python3 is require python3-dnf but this is avaialbe from RHEL 8,doesnt have in RHEL 7.9. 

Kindly help, how to overcome this kind of issue, it would be more helpful for us to move forward.

We are using 2to3 migration tool for converting py2 to py3.

----------
components: 2to3 (2.x to 3.x conversion tool)
messages: 409950
nosy: mskarthik28
priority: normal
severity: normal
status: open
title: Migrating python 2.7 to 3.6 using 2to3 tool
type: compile error
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46288>
_______________________________________


More information about the New-bugs-announce mailing list