Question:
Today, when installing the software package, I found that an error occurred when executing the add apt repository command, and the software source could not be added
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 191, in <module>
if not sp.add_source_from_shortcut(shortcut, options.enable_source):
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 777, in add_source_from_shortcut
if worker.isAlive():
AttributeError: 'Thread' object has no attribute 'isAlive'
reason:
The file softwareproperties.py refers to “isalive”. The python version installed on the computer is 3.9.2. This method is no longer supported in 3.9.
Solution:
Modify the “/ usr/lib/python3/dist packages/softwareproperties/softwareproperties. Py” file, and change the “isalive” in line 777 to “is_live”.
Read More:
- [Solved] AttributeError: module ‘thread‘ has no attribute ‘start_new_thread‘
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- [Solved] AttributeError: ‘PngImageFile‘ object has no attribute ‘imshow‘
- [Solved] vpython: AttributeError: ‘box‘ object has no attribute ‘idx‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- [Solved] AttributeError: ‘DataParallel‘ object has no attribute ‘save‘
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- [Solved] Pycharm error: attributeerror: ‘Htmlparser’ object has no attribute ‘unescape’
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
- AttributeError: DatetimeProperties object has no attribute
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘tolist‘
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘map‘
- [Solved] Networkx Error: Attributeerror: ‘graph’ object has no attribute ‘node’
- [Solved] pandas ExcelWrite AttributeError: ‘NoneType‘ object has no attribute ‘group‘
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] AttributeError: ‘HTMLWriter‘ object has no attribute ‘_temp_names‘
- [Solved] AttributeError WriteOnlyWorksheet object has no attribute cell