Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

cant run yarn-utils.py , with python 3.3.3

Solved Go to solution

cant run yarn-utils.py , with python 3.3.3

Master Collaborator
[root@hadoop1 ~]# python /root/hdp_manual_install_rpm_helper_files-2.5.0.0.1245/scripts/yarn-utils.py -c 16 -m 64 -k True
 Using cores=16 memory=64GB disks=4 hbase=True
Traceback (most recent call last):
  File "/root/hdp_manual_install_rpm_helper_files-2.5.0.0.1245/scripts/yarn-utils.py", line 146, in <module>
    main()
  File "/root/hdp_manual_install_rpm_helper_files-2.5.0.0.1245/scripts/yarn-utils.py", line 99, in main
    reservedStackMemory = getReservedStackMemory(memory)
  File "/root/hdp_manual_install_rpm_helper_files-2.5.0.0.1245/scripts/yarn-utils.py", line 48, in getReservedStackMemory
    if (reservedStack.has_key(memory)):
AttributeError: 'dict' object has no attribute 'has_key'
[root@hadoop1 ~]#
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: cant run yarn-utils.py , with python 3.3.3

Contributor

@Sami Ahmad

The issue is happening as has_key has been removed starting from Python3.

https://docs.python.org/3.1/whatsnew/3.0.html#builtins

To solve the issue, edit yarn-utils.py to change the below lines and see if it helps:-

if (reservedStack.has_key(memory)):

to

if (memory in reservedStack ):

if (reservedHBase.has_key(memory)):

to

if (memory in reservedHBase):

View solution in original post

2 REPLIES 2
Highlighted

Re: cant run yarn-utils.py , with python 3.3.3

Contributor

@Sami Ahmad

The issue is happening as has_key has been removed starting from Python3.

https://docs.python.org/3.1/whatsnew/3.0.html#builtins

To solve the issue, edit yarn-utils.py to change the below lines and see if it helps:-

if (reservedStack.has_key(memory)):

to

if (memory in reservedStack ):

if (reservedHBase.has_key(memory)):

to

if (memory in reservedHBase):

View solution in original post

Highlighted

Re: cant run yarn-utils.py , with python 3.3.3

Master Collaborator

awesome .. that worked .

thanks

Don't have an account?
Coming from Hortonworks? Activate your account here