Solving ModuleNotFoundError: No module named urllib2

Table of Contents Solving ModuleNotFoundError: No module named ‘urllib2’ Method 1: Use the urllib.request module instead of urllib2 Method 2: Use the six library to achieve compatibility 1. Send a GET request 2. Send a POST request 3. Process request header information 4. Handle exceptions Solving ModuleNotFoundError: No module named ‘urllib2’ When writing programs in […]

[Solved] Install mavlink error: aurllib2.URLError: <urlopen error <urlopen error [Errno 111] Connection refused>

When executing the installation mavlink step of installing MAVROS from source code, an error is reported: $ rosinstall_generator –rosdistro melodic mavlink | tee /tmp/mavros.rosinstall Traceback (most recent call last): File “/usr/bin/rosinstall_generator”, line 11, in <module> load_entry_point(‘rosinstall-generator==0.1.22’, ‘console_scripts’, ‘rosinstall_generator’)() File “/usr/lib/python2.7/dist-packages/rosinstall_generator/cli.py”, line 163, in main upstream_version_tag=args.upstream, upstream_source_version=args.upstream_development) File “/usr/lib/python2.7/dist-packages/rosinstall_generator/generator.py”, line 267, in generate_rosinstall wet_package_names, unreleased_repo_names = […]