Addition of Ubuntu 20.04 in easy install script | check_distribution_compatibility() is failing

Background:
Cloud Service: Amazon AWS
Instance Type: t2.micro
Instance OS: Ubuntu 20.04

Using EC2, i spinned a fresh Ubuntu 20.04 LTS instance. After creating a non-root user with sudo rights, and installing the minimals
(sudo apt install python3-minimal build-essential python3-setuptools)
i decided for the easy install script approach.
Upon entering sudo /usr/bin/python3 install.py --production --user myfrappe, i am getting following error message.

Traceback (most recent call last):
File ā€œinstall.pyā€, line 433, in
check_distribution_compatibility()
File ā€œinstall.pyā€, line 78, in check_distribution_compatibility
dist_name, dist_version = get_distribution_info()
File ā€œinstall.pyā€, line 100, in get_distribution_info
current_dist = platform.dist()
AttributeError: module ā€˜platformā€™ has no attribute ā€˜distā€™

Upon checking the install.py script, seems we need to make an entry for Ubuntu 20.
Currently the value is ā€˜ubuntuā€™: [14, 15, 16, 18, 19]

Issue: I thought of editing install.py by myself. So i gave sudo
chmod 777 install.py.
Upon opening the file, i am getting a message ā€˜Directory is non-writableā€™. Still i managed to save, and now the def check_distribution_compatibility() block is having the following entry:
ā€˜ubuntuā€™: [14, 15, 16, 18, 19, 20]

Upon entering sudo /usr/bin/python3 install.py --production --user myfrappe, i am getting same error message.

Traceback (most recent call last):
File ā€œinstall.pyā€, line 433, in
check_distribution_compatibility()
File ā€œinstall.pyā€, line 78, in check_distribution_compatibility
dist_name, dist_version = get_distribution_info()
File ā€œinstall.pyā€, line 100, in get_distribution_info
current_dist = platform.dist()
AttributeError: module ā€˜platformā€™ has no attribute ā€˜distā€™

Should i raise a Feature Request for this to be updated in easy install script since Ubuntu 20.04 LTS is released recently?

Note: I have installed V12 through manual mode in Ubuntu 18.04. So i believe i can make it work in 20.04 also. Still thought of taking easy install script way. Can this be resolved locally?

Thanks for your time.

Bala

1 Like

This is also happening in my VM, Ubuntu 20.04. hopefully someone solve this problem

I think you should stick to compatible OS versions until devs check new OS versions for issues, dependency compatibility and adds support. Best guess is they do this to prevent frequent dependency issues that arise from new OS/Distros breaking install/running due to dependency changes.

It might be easier to upgrade from 18 to 20 with a working ERPNext instance in place.

Hi guys,

the issues are from python3 (3.7 and above), because platform.dist() is deprecated.

So the function check_distribution_compatibility() runs into errors. It will work with python2.

Appreciate the pointer. I will check and update.
Thanks,
Balachandran

libssl1.0-dev is missing / libssl1.1 wanted

The full traceback is:
File ā€œ/tmp/ansible_apt_payload_3anw_53t/main.pyā€, line 434, in package_status
pkg = cache[pkgname]
File ā€œ/usr/lib/python3/dist-packages/apt/cache.pyā€, line 305, in getitem
raise KeyError(ā€˜The cache has no package named %rā€™ % key)
fatal: [localhost]: FAILED! => {
ā€œchangedā€: false,
ā€œinvocationā€: {
ā€œmodule_argsā€: {
ā€œallow_unauthenticatedā€: false,
ā€œautocleanā€: false,
ā€œautoremoveā€: false,
ā€œcache_valid_timeā€: 0,
ā€œdebā€: null,
ā€œdefault_releaseā€: null,
ā€œdpkg_optionsā€: ā€œforce-confdef,force-confoldā€,
ā€œforceā€: true,
ā€œforce_apt_getā€: false,
ā€œinstall_recommendsā€: null,
ā€œonly_upgradeā€: false,
ā€œpackageā€: [
ā€œlibssl1.0-devā€
],
ā€œpkgā€: [
ā€œlibssl1.0-devā€
],
ā€œpolicy_rc_dā€: null,
ā€œpurgeā€: false,
ā€œstateā€: ā€œpresentā€,
ā€œupdate_cacheā€: null,
ā€œupgradeā€: null
}
},
ā€œmsgā€: ā€œNo package matching ā€˜libssl1.0-devā€™ is availableā€

Source: /usr/lib/python3/dist-packages/apt/cache.py

The below section is failing
def getitem(self, key):
# type: (object) ā†’ Package
ā€œā€" look like a dictionary (get key) ā€œā€"
try:
key = str(key)
rawpkg = self._cache[key]
except KeyError:
raise KeyError(ā€˜The cache has no package named %rā€™ % key)

    # It might be excluded due to not having a version or something
    if not self.__is_real_pkg(rawpkg):
        raise KeyError('The cache has no package named %r' % key)

    pkg = self._rawpkg_to_pkg(rawpkg)

    return pkg

Seems for Ubuntu focal, libssl version is now libssl1.1 and I have downloaded it, also verified by sudo apt-cache search ā€œlibssl1.1ā€

Based on above traceback, can some one suggest where should i modify the package name as libssl1.1? I searched in cache.py but it seems libssl version is fetched dynamically.

I am having the same issue. Can some one suggest what could we do in this situation?

Traceback (most recent call last):
File ā€œinstall.pyā€, line 433, in
check_distribution_compatibility()
File ā€œinstall.pyā€, line 78, in check_distribution_compatibility
dist_name, dist_version = get_distribution_info()
File ā€œinstall.pyā€, line 100, in get_distribution_info
current_dist = platform.dist()
AttributeError: module ā€˜platformā€™ has no attribute ā€˜distā€™

I have just posted a link to a new ERPNext installer.

Please give it a try if your current method is unsuccessful.

Iā€™ll be very grateful for any feedback you can offer.
.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.