hjweide / pyastar2d

A very simple A* implementation in C++ callable from Python for pathfinding on a two-dimensional grid.
MIT License
150 stars 57 forks source link

How can I run this in windows #5

Closed saminhasan closed 3 years ago

saminhasan commented 4 years ago

I ran nmake to make astar.so.

When I tried to run the example.py, i got this error -

     File "pyastar.py", line 9, in <module>
        lib = ctypes.cdll.LoadLibrary(join(dirname(fname), 'astar.so'))
      File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 442, in LoadLibrary
        return self._dlltype(name)
      File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 364, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: [WinError 193] %1 is not a valid Win32 application
hjweide commented 4 years ago

Unfortunately this version is only supported on Linux. I have a fix available to make it work on Windows and hope to release it soon.

jonasbp2011 commented 4 years ago

Hi, are there any news on the Windows compatible version?

m3talstorm commented 4 years ago

The above error is typical when compiling on one platform (like Linux) and trying to run it on windows.

Run make on the windows machine.

hjweide commented 4 years ago

Hi, are there any news on the Windows compatible version?

I made some changes recently that moved building the shared object file to setup.py instead of a Makefile, and was able to get it running on Windows after install Cython manually. See if that works for you too:

pip install Cython
pip install .