Open Gronchii opened 2 months ago
For the second problem, I think you also need to have the top-level source directory as well in PYTHONPATH, e.g. the equivalents of step 5 in these instructions: https://github.com/google-deepmind/open_spiel/blob/master/docs/install.md#summary
Based on your paths above that would be D:\OpenSpiel\open_spiel\open_spiel.
For the first problem, I don't know how to solve it. If the DLL is being built and it's in the PYTHONPATH then Python should be able to load it. Possibly Python is not setup to look into the PYTHONPATH, but that worked for me last time I tried it.
You are correct, adding top-level did resolve the open_spiel.python import. The pyspiel import issue looks to be due to conda, the dll loads fine when run outside of a conda environment so I will see if I can get that sorted
Thanks
I have managed to get this to build successfully on windows after some changes for MSVC, but I am not able to import into python. I followed the windows build guide and added the 2 paths to my PYTHONPATH:
-D:\OpenSpiel\open_spiel\open_spiel\out\build\x64-Debug -D:\OpenSpiel\open_spiel\open_spiel\out\build\x64-Debug\python
However, I now have 2 issues when trying to import into python script.
The first is when I try to import pyspiel through python
import pyspiel
I get this error:
ImportError: DLL load failed while importing pyspiel: The specified module could not be found.
I do see where pyspiel.pyd is present inside
build\x64-Debug\python
, and when I remove from PYTHONPATH it no longer is able to find the module at all.The second python issue is when I try to run
open_spiel\python\examples\example.py
I get a different error relating to attempting to import fromopen_spiel.python
Traceback (most recent call last): File "d:\OpenSpiel\open_spiel\open_spiel\python\examples\example.py", line 24, in <module> from open_spiel.python import games # pylint: disable=unused-import ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'open_spiel'
Any insight would be appreciated