Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

cant run yarn-utils.py , with python 3.3.3

avatar
Super 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

avatar
New Member

@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

avatar
New Member

@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):

avatar
Super Collaborator

awesome .. that worked .

thanks