2

Ok, so I finally got poker-eval and pypoker to install correctly. If I go to the pypoker folder in cygwin, and type python test.py, it runs the program fine. However, if I copy the test.py file over to a netbeans project main file, I get the error ImportError: No module named _pokereval_2_7. The problem is, I am using wxpython, and it won't let me execute my program from cygwin. I am using NetBeans, so my entire project is developed there. If I try to include pypoker-eval, I get this error.

> Traceback (most recent call last):  
> File
> "C:\Users\JeremyLaptop\Documents\NetBeansProjects\testing\src\testing.py",
> line 36, in <module>
>     from pokereval import PokerEval   File
> "C:\Users\JeremyLaptop\Desktop\pypoker-eval-137.0\pokereval.py",
> line 29, in <module>
>     _pokereval = __import__('_pokereval_' + sys.version[0] + '_' + sys.version[2])
> ImportError: No module named _pokereval_2_7. 

I have been trying to figure out how to get this to work for hours, hopefully one of you guys can help.

FYI: Windows 7, pypoker and pokereval folders are on my desktop. Projects are saved in C:/users/myname/my documents/netbeansprojects.

Nikana Reklawyks
  • 3,233
  • 3
  • 33
  • 49
ULcajun
  • 143
  • 1
  • 3
  • 8

3 Answers3

0

A quick look at the source code makes it seem that Python 2.7 is not supported by that library. Try using Python 2.6 instead.

Mark Hildreth
  • 42,023
  • 11
  • 120
  • 109
  • I just downloaded python 2.6, now it's giving me the same error, but for version 2.6. I think python is not checking the correct path to try to find the libraries. Does it matter that my folders are on my desktop? and how would i tell python where to find it – ULcajun Mar 21 '11 at 00:03
0

An example of a ready made Texas Hold'em 7- and 5-card evaluator can be found here with documentation and further explained here. It goes by the name of "SpecialKEval". All feedback welcome at the e-mail address found therein.

You can typically (~97% of the time) get away with just 6 additions and a couple of bit shifts. The algo uses a generated look up table which occupies about 9MB of RAM and is generated in a near-instant. Cheap. All of this is done inside of 32-bits, and "inlining" the 7-card evaluator is good for evaluating about 50m randomly generated hands per second on my laptop.

This might be a useful alternative to you in your project.

Ken
  • 30,811
  • 34
  • 116
  • 155
0

I had a similar problem. It did not install by default into the default location for my python installation. If something similar is going on for you, then it is probably just not in your PYTONPATH. You can get around that by providing one (or adjusting the path in netbeans, not 100% sure how to do this, but it should be a standard operation) or copying the contents of the site package into your project.

David H. Clements
  • 3,590
  • 2
  • 24
  • 26