Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: when importing pokergames.leduc_gametree #8

Open
xoren22 opened this issue Jul 6, 2020 · 1 comment
Open

AttributeError: when importing pokergames.leduc_gametree #8

xoren22 opened this issue Jul 6, 2020 · 1 comment

Comments

@xoren22
Copy link

xoren22 commented Jul 6, 2020

machine: intel core i3, Ubuntu 16.04, python 3.6
how to reproduce -

  1. git clone repo
  2. cd to local folder containing the repo
  3. create a jupyter notebook and import leduc as follows from pokergames import leduc_gametree

The error message attached below:

`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
----> 1 from pokergames import leduc_gametree

~/Desktop/pycfr/pokergames.py in
----> 1 from pokertrees import *
2
3 def kuhn_eval(hc, board):
4 return hc[0].rank
5

~/Desktop/pycfr/pokertrees.py in
3 from itertools import product
4 from collections import Counter
----> 5 from hand_evaluator import HandEvaluator
6 from copy import deepcopy
7 from functools import partial

~/Desktop/pycfr/hand_evaluator.py in
----> 1 from lookup_tables import LookupTables
2 from popcount import PopCount
3 from itertools import combinations
4 from operator import mul, or, and, xor
5

~/Desktop/pycfr/lookup_tables.py in
----> 1 from card import Card
2
3 class LookupTables:
4 """
5 Top level attributes are general, like primes, deck, etc

~/Desktop/pycfr/card.py in
1 import re
2
----> 3 class Card:
4 SUIT_TO_STRING = {
5 1: "s",

~/Desktop/pycfr/card.py in Card()
30 RANK_ACE = 14
31
---> 32 STRING_TO_SUIT = dict([(v, k) for k, v in SUIT_TO_STRING.iteritems()])
33 STRING_TO_RANK = dict([(v, k) for k, v in RANK_TO_STRING.iteritems()])
34

AttributeError: 'dict' object has no attribute 'iteritems'`

@tansey
Copy link
Owner

tansey commented Jul 6, 2020

This is a python 3 compatibility issue. Right now the code only supports python 2.7. I'm happy to accept a pull request if anyone wants to upgrade the code. I'm not sure when I'll have time to do it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants