ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

i get fatal error with pip and python

asked 2021-06-05 19:55:20 -0500

hoangdung2000 gravatar image

updated 2021-06-06 02:51:06 -0500

gvdhoorn gravatar image

i get fatal error with pip and python

had@had-HP-Pavilion-Laptop-15-cs0xxx:~$ python3.5 -m pip install catkin_pkg
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

had@had-HP-Pavilion-Laptop-15-cs0xxx:~$ pip3 install --upgrade pip
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

had@had-HP-Pavilion-Laptop-15-cs0xxx:~$ python3 -m pip install --upgrade pip
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-05 21:35:34 -0500

JohnStechschulte gravatar image

This looks like a Python 2/3 issue, especially since you've added the kinetic tag (which is still using Python 2). Try using Python 2.

edit flag offensive delete link more

Comments

I get this message when I switch to python 2:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/develop... pip 21.0 will remove support for this functionality.

Defaulting to user installation because normal site-packages is not writeable Requirement already up-to-date: pip in ./.local/lib/python2.7/site-packages (20.3.4)

hoangdung2000 gravatar image hoangdung2000  ( 2021-06-06 04:18:22 -0500 )edit

Yup, you're using old software. It'll still work, but if you want to use Python 3 you need to upgrade to Ubuntu 20.04 and ROS Noetic (or ROS2). You're not alone--the metrics suggest that most ROS users are still on 18.04 or earlier.

JohnStechschulte gravatar image JohnStechschulte  ( 2021-06-06 11:27:11 -0500 )edit

Thank you very much, by the way I want to make a simulation example that controls turtlebot to move along a diamond in Rviz. What steps should I take?

hoangdung2000 gravatar image hoangdung2000  ( 2021-06-08 02:45:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-06-05 19:55:20 -0500

Seen: 687 times

Last updated: Jun 06 '21