2

I tried installing the deuces package in python using

python -m pip install deuces

which installed perfectly. But whenever I attempt to call upon the function, I get an error message:

Traceback (most recent call last): File "", line 1, in File "C:\Python\Anaconda\lib\site-packages\deuces__init__.py", line 1, in from card import Card ModuleNotFoundError: No module named 'card'

Even though I can't find anything wrong with the module calling. Would someone be able to check what's going wrong here?

PS: I did read the post Import Error Python: No module named 'card' but found no solution.

enter image description here

Mitchell Faas
  • 430
  • 6
  • 19

2 Answers2

4

It seems the package is using python 2 only relative imports here, which was removed py PEP 404.

These should be changed to either douces.xxx or relative imports .xxx. Currently, your best hope would be to make a PR to fix this, or to fork the library and fix it yourself.

Jonas Adler
  • 10,365
  • 5
  • 46
  • 73
  • This totally worked! Would you mind explaining to me what PR means in this context? – Mitchell Faas Jul 25 '17 at 22:40
  • PR means "pull request" in github. Apparently someone else has done one here: https://github.com/worldveil/deuces/pull/12, but it seems your package does not intend to support python 3. – Jonas Adler Jul 25 '17 at 23:05
2

You are most likely trying to run this code in Python 3. Sadly the deuces module's page in the PyPI repository does not make it clear that the module currently only appears to support Python 2, under which the module imports perfectly.

Since it doesn't look like the module has received much attention lately, if you want to run it under Python 3 you may end up doing the port yourself. It doesn't look as though it would take too much work.

holdenweb
  • 33,305
  • 7
  • 57
  • 77