amazon-archives / aws-robomaker-sample-application-deepracer

Use AWS RoboMaker and demonstrate running a simulation which trains a reinforcement learning (RL) model to drive a car around a track
MIT License
112 stars 59 forks source link

ModuleNotFoundError: No module named 'apt' #6

Closed exitNA closed 5 years ago

exitNA commented 5 years ago

hi, when i do colcon bundle, i got an error:

ERROR:colcon.colcon_core.entry_point:Exception loading extension 'colcon_bundle.installer.apt': No module named 'apt'
Traceback (most recent call last):
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/entry_point.py", line 98, in load_entry_points
    extension_type = load_entry_point(entry_point)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/entry_point.py", line 140, in load_entry_point
    return entry_point.load()
  File "/home/mark/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/home/mark/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_bundle/installer/apt.py", line 9, in <module>
    from apt.cache import FetchFailedException
ModuleNotFoundError: No module named 'apt'

Bundling workspace...
[0.765s] ERROR:colcon.colcon_core.entry_point:Exception loading extension 'colcon_bundle.installer.apt': No module named 'apt'
Traceback (most recent call last):
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/entry_point.py", line 98, in load_entry_points
    extension_type = load_entry_point(entry_point)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/entry_point.py", line 140, in load_entry_point
    return entry_point.load()
  File "/home/mark/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/home/mark/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_bundle/installer/apt.py", line 9, in <module>
    from apt.cache import FetchFailedException
ModuleNotFoundError: No module named 'apt'

Collecting dependency information...
Starting >>> deepracer_msgs
loading view [*default*] with rospkg loader  
--- stderr: deepracer_msgs
Traceback (most recent call last):
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/task/__init__.py", line 92, in __call__
    return await task_method(*args, **kwargs)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_ros_bundle/task/ros_bundle.py", line 38, in bundle
    rule_installer, rule = rosdep.get_rule(dependency.name)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_ros_bundle/task/catkin/_rosdep.py", line 40, in get_rule
    self.default_key)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/rosdep2/lookup.py", line 106, in get_rule_for_platform
    raise ResolutionError(rosdep_key, data, os_name, os_version, 'No definition of [%s] for OS [%s]' % (rosdep_key, os_name))
rosdep2.lookup.ResolutionError: No definition of [std_msgs] for OS [debian]
    rosdep key : std_msgs
    OS name    : debian
    OS version : 
    Data: _is_ros: true
osx:
  homebrew:
    packages:
    - ros/kinetic/std_msgs
ubuntu:
  xenial:
    apt:
      packages:
      - ros-kinetic-std-msgs

---
Failed   <<< deepracer_msgs [ Exited with code 1 ]
Starting >>> deepracer_simulation
loading view [*default*] with rospkg loader                   
--- stderr: deepracer_simulation
Traceback (most recent call last):
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/task/__init__.py", line 92, in __call__
    return await task_method(*args, **kwargs)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_ros_bundle/task/ros_bundle.py", line 38, in bundle
    rule_installer, rule = rosdep.get_rule(dependency.name)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_ros_bundle/task/catkin/_rosdep.py", line 40, in get_rule
    self.default_key)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/rosdep2/lookup.py", line 132, in get_rule_for_platform
    raise ResolutionError(rosdep_key, self.data, os_name, os_version, 'No definition of [%s] for OS version [%s]' % (rosdep_key, os_version))
rosdep2.lookup.ResolutionError: No definition of [gazebo] for OS version []
    rosdep key : gazebo
    OS name    : debian
    OS version : 
    Data: arch:
- gazebo
debian:
  buster:
  - gazebo7
  jessie:
  - gazebo7
  stretch:
  - gazebo7
fedora:
- gazebo-devel
gentoo:
- sci-electronics/gazebo
slackware:
- gazebo
ubuntu:
  artful:
  - gazebo9
  bionic:
  - gazebo9
  precise:
  - gazebo
  quantal:
  - gazebo
  raring:
  - gazebo
  saucy:
  - gazebo2
  trusty:
  - gazebo2
  wily:
  - gazebo7
  xenial:
  - gazebo7
  yakkety:
  - gazebo7
  zesty:
  - gazebo7

---
Failed   <<< deepracer_simulation   [ Exited with code 1 ]
Starting >>> sagemaker_rl_agent
--- stderr: sagemaker_rl_agent
Traceback (most recent call last):
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/task/__init__.py", line 92, in __call__
    return await task_method(*args, **kwargs)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_bundle/task/python/bundle.py", line 47, in bundle
    apt = args.installers['apt']
KeyError: 'apt'
---
Failed   <<< sagemaker_rl_agent [ Exited with code 1 ]

Summary: 0 packages finished [0.60s]
  3 packages failed: deepracer_msgs deepracer_simulation sagemaker_rl_agent
  3 packages had stderr output: deepracer_msgs deepracer_simulation sagemaker_rl_agent
  1 package not processed
[1.206s] ERROR:colcon:colcon bundle: [Errno 2] No such file or directory: '/home/mark/repo/aws-robomaker-sample-application-deepracer/simulation_ws/bundle/bundle_staging/setup.sh'
Traceback (most recent call last):
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_core/command.py", line 436, in verb_main
    rc = context.args.main(context=context)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_bundle/verb/bundle.py", line 142, in main
    generate_archive_v1(install_base, staging_path, bundle_base)
  File "/home/mark/anaconda3/lib/python3.7/site-packages/colcon_bundle/verb/_archive_generators.py", line 28, in generate_archive_v1
    shutil.copy2(shellscript_path, os.path.join(staging_path, 'setup.sh'))
  File "/home/mark/anaconda3/lib/python3.7/shutil.py", line 257, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/mark/anaconda3/lib/python3.7/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/mark/repo/aws-robomaker-sample-application-deepracer/simulation_ws/bundle/bundle_staging/setup.sh'

someone has an idea about this?

x77a1 commented 5 years ago

@exitNA, It seems that 'apt' module is missing on the build machine. Could you please try to install python3-apt prior to running the build again?

apt-get install -y python3-apt

Also could you please share the details of how you installed colcon-bundle. We will also try to reproduce the issue on our side and update our documentation to avoid similar issue in future.

exitNA commented 5 years ago

@x77a1 I use anaconda python 3.7, follow the README.md, install colcon-ros-bundle

# 1. install anaconda
./Anaconda3-2018.12-Linux-x86_64.sh 

# restart my shell to use anaconda python

# 2. install colcon-ros-bundle
pip3 install colcon-ros-bundle
exitNA commented 5 years ago

@x77a1 should I use python 2 not python 3? and what is the version of ROS? Is it Kinetic ?

x77a1 commented 5 years ago

@exitNA This seems to be a miss in the documentation. It should also have instruction to install python3-apt. I will raise a PR for that change. Did you get a chance to try after installing python3-apt package?

We support running it on top ROS Kinetic currently.

x77a1 commented 5 years ago

@exitNA We have updated the instruction to install the packages needed to run the build locally. I am going to close this issue. Please let us know incase you are still facing the issue.