runing official turtlesim tutorials:AttributeError: module 'enum' has no attribute 'IntFlag'

asked 2020-04-27 07:53:43 -0500

resplendent star gravatar image

updated 2020-04-27 07:56:42 -0500

runing official tutorials:

  1. List item

console output :

rosrun rqt_graph rqt_graph Traceback (most recent call last): File "/opt/ros/melodic/lib/rqt_graph/rqt_graph", line 5, in <module> from rqt_gui.main import Main File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_gui/main.py", line 38, in <module> from qt_gui.main import Main as Base File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/main.py", line 35, in <module> from argparse import ArgumentParser, SUPPRESS File "/home/lzw/anaconda3/lib/python3.7/argparse.py", line 87, in <module> import re as _re File "/home/lzw/anaconda3/lib/python3.7/re.py", line 143, in <module> class RegexFlag(enum.IntFlag):

AttributeError: module 'enum' has no attribute 'IntFlag'

  1. List item

here is my bashrc

export PATH="/home/lzw/.local/bin:$PATH"

ros

source /opt/ros/melodic/setup.bash #

source /home/lzw/resplendent_code/kimera_ros1_ws/devel/setup.bash

source /home/lzw/resplendent_code/k_s_ros1_ws/devel/setup.bash

source /home/lzw/resplendent_code/kimera_semantic_ws/devel/setup.bash

run 3D tracking ImportError: /home/lzw/resplendent_code/voxblox_pp_ws/devel/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type

source /home/lzw/resplendent_code/voxblox_pp_ws/devel/setup.bash

cuda 10.1

export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}

export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

cuda10.0

export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

cuda 9.0

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}

export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

:<

>>> conda initialize >>>

!! Contents within this block are managed by 'conda init' !!

__conda_setup="$('/home/lzw/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/lzw/anaconda3/etc/profile.d/conda.sh" ]; then . "/home/lzw/anaconda3/etc/profile.d/conda.sh" else export PATH="/home/lzw/anaconda3/bin:$PATH" fi fi unset __conda_setup

<<< conda initialize <<<

!

:</dev/null 2>&1; then eval "$(pyenv init -)" fi !

echo -e '\nexport PYENV_ROOT="$HOME/.pyenv"\nexport PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc

export PATH="/home/lzw/anaconda3/bin:$PATH"

export PATH=/home/lzw/3d_lib/clion-2019.3.4/bin:${PATH}

for facebook sparse conv net

export CC=/usr/bin/gcc-6

export CXX=/usr/bin/g++-6

ros learn

source /home/lzw/resplendent_code/basic_code/teach_ws/devel/setup.bash


3.

if i runing [source ~/.bashrc]

will output : source ~/.bashrc Traceback (most recent call last): File "/usr/lib/command-not-found", line 23, in <module> import gettext File "/usr/lib/python3.6/gettext.py", line 49, in <module> import locale, copy, io, os, re, struct, sys File "/usr/lib/python3.6/locale.py", line 16, 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 53, in apport_excepthook if not enabled ... (more)

edit retag flag offensive close merge delete

Comments

All of this is explainable by the fact that you're mixing Python 3 and Python 2:

File "/home/lzw/anaconda3/lib/python3.7/re.py

Note the anaconda3 in there.

ROS Melodic does not support Python 3.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-27 08:27:26 -0500 )edit