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.