The error details are as follows:
Traceback (most recent call last):
File "/usr/local/bin/evo_traj", line 5, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 62, in apport_excepthook
if not enabled():
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/evo_traj", line 5, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Problem analysis
this problem has not occurred before. It is suspected that the python iteration version conflict is caused by the update of Ubuntu system. It is recommended to turn off the automatic update of Ubuntu to prevent such problems. It takes a long time to solve some version conflict problems.
Solution:
the query found that pythonpath was set incorrectly. The configuration left by the previous use of python2 was saved in. Bashrc, resulting in python3 unable to find the correct enum location. After commenting out the relevant statements in bashrc, clear the $pythonpath variable:
unset PYTHONPATH
echo $PYTHONPATH
Then it can be used normally. Pythonpath is a multi-purpose configuration in python2. It is generally no longer needed after using python3.
Read More:
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- Python3.7 AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] AttributeError: module ‘pandas‘ has no attribute ‘rolling_count‘
- [Solved] AttributeError: module ‘PIL.Image‘ has no attribute ‘open‘
- [Solved] AttributeError: module ‘dlib‘ has no attribute ‘get_face_chip‘
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- BlazingSQL Error: AttributeError: module ‘cio‘ has no attribute ‘RunQueryError‘
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- [Solved] AttributeError: ‘module‘ object has no attribute ‘CALIB_HAND_EYE_PARK‘
- [Perfectly Solved] attributeerror: module ‘SciPy. Misc’ has no attribute ‘toimage’ error
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘stats’