Python error on Ubuntu 20.04
sanjarcode opened this issue · comments
Sanjar Afaq commented
Error.
Traceback (most recent call last):
File "<string>", line 24, in <module>
TypeError: unsupported operand type(s) for |: '_Environ' and 'dict'
Traceback (most recent call last):
File "<string>", line 76, in <module>
AttributeError: module 'os' has no attribute 'waitstatus_to_exitcode'
My system:
- Ubuntu 20.04
- Using bash (default)
- System python is 3.8
- Available python(s) - 3.9, 3.10 using Pyenv available through
python3
(this is not the problem afaict)
polyipseity commented
The errors are consistent with running Python 3.8.
- The first error is because merging
_Environ
anddict
using|
is only supported in 3.9: https://docs.python.org/3/library/os.html#os.environ - The second error is because
waitstatus_to_exitcode
is only available in 3.9: https://docs.python.org/3/library/os.html#os.waitstatus_to_exitcode
You will need to change the Python executable to point to Python 3.9 (should work) or 3.10 (recommended) using absolute paths. You could also fix your PATH
or your pyenv
configuration.
I have added a button next to the Python executable setting to check the Python version for this issue. (dce6ead..1521bd5) You will need to update the plugin to 3.1.0 to use it. You can use it to see whether the Python version is correct.