[Solved] NameError: name ‘reload’ is not defined on ROS melody terminal

Solve in Ubuntu 18 After installing ROS melody under 04, the terminal appears NameError: name ‘reload’ is not defined

Method 1:

Comment out the melodic source in .bashrc, .zshrc, for example:

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

Method 2:

Comment out the code in /opt/ROS/melody/lib/python2.7/dist-packages/sitecustomize.py

#coding=utf8
#import sys
#reload(sys)
#sys.setdefaultencoding('utf8')

Read More: