Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.9.2: AttributeError: module 'platform' has no attribute 'linux_distribution' #27

Open
ghost opened this issue Mar 15, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 15, 2021

Already use:

yum remove python3-pip
python3.9 -m easy_install pip

But still the same problem:

[root@ip-172-26-1-89 4]# python3.9 -m pip install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (21.0.1)

[root@ip-172-26-1-89 4]# python3.9 -m pip install psutil

Collecting psutil
  Using cached psutil-5.8.0-cp39-cp39-manylinux2010_x86_64.whl (293 kB)
Installing collected packages: psutil
Successfully installed psutil-5.8.0

[root@ip-172-26-1-89 4]# python3.9 -m pip install netifaces
Requirement already satisfied: netifaces in /usr/local/lib/python3.9/site-packages (0.10.9)

[root@ip-172-26-1-89 4]# python3.9 -m pip install pyvalid

Requirement already satisfied: pyvalid in /usr/local/lib/python3.9/site-packages (1.0.4)
Requirement already satisfied: six~=1.15 in /usr/local/lib/python3.9/site-packages (from pyvalid) (1.15.0)

[root@ip-172-26-1-89 4]# python3.9 -m pip install enum34
Requirement already satisfied: enum34 in /usr/local/lib/python3.9/site-packages (1.1.10)

[root@ip-172-26-1-89 4]# python3.9 -m pip install distro

Collecting distro
  Downloading distro-1.5.0-py2.py3-none-any.whl (18 kB)
Installing collected packages: distro
Successfully installed distro-1.5.0

[root@ip-172-26-1-89 4]# python3.9

Python 3.9.2 (default, Mar  9 2021, 23:51:05)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyspectator.computer import Computer
>>> computer = Computer()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/pyspectator/computer.py", line 18, in __init__
    self.__os = Computer.__get_os_name()
  File "/usr/local/lib/python3.9/site-packages/pyspectator/computer.py", line 88, in __get_os_name
    if ('Linux' in system) and ('' not in platform.linux_distribution()):
AttributeError: module 'platform' has no attribute 'linux_distribution'
>>> exit(9
... )

[root@ip-172-26-1-89 4]# python3.9 -V

Python 3.9.2

[root@ip-172-26-1-89 4]# cat /etc/os-release

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants