Support Questions

Find answers, ask questions, and share your expertise

Python print error during installation - python aliased to 2.7

New Contributor

I am trying to setup a single host example - still trying to understand the deployment.

I'm getting what reads like a python print error during the installation process.

CentOS 7, with Python 2.7 set as the python alias.

The machine also has Anaconda (Python 3) on it, but vanilla Python 2.7 should be what's executing.

Happy to provide any other info - not sure what else would be helpful at this point - feels like I must be missing something I'm just not catching.

==========================
Creating target directory...
==========================

Command start time 2017-03-26 01:30:34
chmod: cannot access ‘/var/lib/ambari-agent/data’: No such file or directory

Connection to localhost closed.
SSH command execution finished
host=localhost, exitcode=0
Command end time 2017-03-26 01:30:34

==========================
Copying ambari sudo script...
==========================

Command start time 2017-03-26 01:30:34

scp /var/lib/ambari-server/ambari-sudo.sh
host=localhost, exitcode=0
Command end time 2017-03-26 01:30:34

==========================
Copying common functions script...
==========================

Command start time 2017-03-26 01:30:34

scp /usr/lib/python2.6/site-packages/ambari_commons
host=localhost, exitcode=0
Command end time 2017-03-26 01:30:34

==========================
Copying OS type check script...
==========================

Command start time 2017-03-26 01:30:34

scp /usr/lib/python2.6/site-packages/ambari_server/os_check_type.py
host=localhost, exitcode=0
Command end time 2017-03-26 01:30:35

==========================
Running OS type check...
==========================

Command start time 2017-03-26 01:30:35
  File "/var/lib/ambari-agent/tmp/os_check_type1490506234.py", line 27
    print "Usage: <cluster_os>"
                              ^
SyntaxError: Missing parentheses in call to 'print'

Connection to localhost closed.
SSH command execution finished
host=localhost, exitcode=1
Command end time 2017-03-26 01:30:35

ERROR: Bootstrap of host localhost fails because previous action finished with non-zero exit code (1)
ERROR MESSAGE: Connection to localhost closed.

STDOUT:   File "/var/lib/ambari-agent/tmp/os_check_type1490506234.py", line 27
    print "Usage: <cluster_os>"
                              ^
SyntaxError: Missing parentheses in call to 'print'

Connection to localhost closed.
2 REPLIES 2

Super Mentor

@M Gladney

You should uninstall the ambari-agent and then install it again. So that the respective python libraries of ambari agent gets refreshed.

# ambari-agent stop
# yum remove ambari-agent -y
# yum clean all
# yum install ambari-agent -y

.

If you have references to conda3 in your PATH that may not work. Try to remove such references (comment out the line added by conda3 installer to your .bashrc) or install conda2 so that your conda root environment is on Python-2, and install Python-3 as an additional environment.