An error occurred in the course "python for robotics"

Please help!!
Traceback (most recent call last):
File “pyscript1.py”, line 1, in
from robot_control_class import RobotControl
File “/home/user/catkin_ws/src/robot_control/robot_control_class.py”, line 3, in
import rospy
File “/opt/ros/noetic/lib/python3/dist-packages/rospy/init.py”, line 49, in
from .client import spin, myargv, init_node,
File “/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py”, line 52, in
import roslib
File “/opt/ros/noetic/lib/python3/dist-packages/roslib/init.py”, line 50, in
from roslib.launcher import load_manifest # noqa: F401
File “/opt/ros/noetic/lib/python3/dist-packages/roslib/launcher.py”, line 42, in
import rospkg
File “/usr/lib/python3/dist-packages/rospkg/init.py”, line 41, in
from .manifest import InvalidManifest, Manifest, parse_manifest_file
File “/usr/lib/python3/dist-packages/rospkg/manifest.py”, line 40, in
import xml.dom.minidom as dom
File “/usr/lib/python3.8/xml/dom/minidom.py”, line 23, in
from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS
File “/usr/lib/python3.8/xml/dom/xmlbuilder.py”, line 3, in
import copy
File “/home/user/catkin_ws/src/robot_control/copy.py”, line 1, in
from robot_control_class import RobotControl
ImportError: cannot import name ‘RobotControl’ from partially initialized module ‘robot_control_class’ (most likely due to a circular import) (/home/user/catkin_ws/src/robot_control/robot_control_class.py)

What exactly were you trying to do that led to this error? Which unit and which exercise or example were you trying to do?

You hit a “circular import” error because you are probably doing something wrongly, probably wrong copy-paste!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.