wroberts / pydaedalus Goto Github PK
View Code? Open in Web Editor NEWA Python wrapper of the Daedalus maze generator.
License: GNU General Public License v2.0
A Python wrapper of the Daedalus maze generator.
License: GNU General Public License v2.0
It was recommended by pip that I install using this command: python -m pip install --use-pep517 pydaedalus
This did not correct major errors I am having on install.
Currently the wheel is not building.
This is the command and output:
PS D:\Commerce\A&XB_Designs\PROJECTS\IMPOSSIBLE_MAZE_BOOK_1> python -m pip install --use-pep517 pydaedalus
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Collecting pydaedalus
Using cached pydaedalus-0.1.5.tar.gz (400 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pydaedalus
Building wheel for pydaedalus (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pydaedalus (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\daedalus
copying daedalus\compat.py -> build\lib.win-amd64-cpython-310\daedalus
copying daedalus\__init__.py -> build\lib.win-amd64-cpython-310\daedalus
creating build\lib.win-amd64-cpython-310\daedalus\test
copying daedalus\test\test_maze.py -> build\lib.win-amd64-cpython-310\daedalus\test
copying daedalus\test\__init__.py -> build\lib.win-amd64-cpython-310\daedalus\test
running build_ext
building 'daedalus._maze' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\daedalus
creating build\temp.win-amd64-cpython-310\Release\daedalus\src
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Idaedalus/src -IC:\Python310\include -IC:\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019
\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Fil
es (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpdaedalus/_maze.cpp /Fobuild\temp.win-amd64-cpython-310\Release\daedalus/_maze.obj -std=c++11 -Wno-error=format-security
cl : Command line error D8021 : invalid numeric argument '/Wno-error=format-security'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pydaedalus
Failed to build pydaedalus
ERROR: Could not build wheels for pydaedalus, which is required to install pyproject.toml-based projects
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>> from daedalus import Maze
>>> maze = Maze(63, 63)
>>> maze.create_perfect()
>>> maze.resize(31, 61)
>>> maze.create_perfect()
>>> maze.save_bitmap('test.bmp')
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
maze.save_bitmap('test.bmp')
File "daedalus/_maze.pyx", line 1626, in daedalus._maze.Maze.save_bitmap (daedalus/_maze.cpp:9643)
TypeError: expected bytes, str found
>>> maze.save_text('test.txt')
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
maze.save_text('test.txt')
File "daedalus/_maze.pyx", line 1646, in daedalus._maze.Maze.save_text (daedalus/_maze.cpp:9843)
TypeError: expected bytes, str found
>>>
(apologies if this isn't the appropriate place to ask questions, but I don't know another place)
After "pip install pydaedalus" under Anaconda Python 2.7.13 on Mac, I get
ImportError Traceback (most recent call last)
<ipython-input-1-526a22e210bd> in <module>()
2 import matplotlib.pyplot as plt
3 import numpy as np
----> 4 from daedalus import Maze
/Users/bbeckman/Documents/pydaedalus/daedalus/__init__.py in <module>()
25 __version__ = "unknown (%s)" % ex
26
---> 27 from ._maze import (Maze,
28 COLOR_WHITE, COLOR_BLACK,
29 ENTRANCE_CORNER, ENTRANCE_MIDDLE, ENTRANCE_BALANCED, ENTRANCE_RANDOM)
ImportError: No module named _maze
I deduce that I must build the cpp sources and figure out how to get an interop module "_maze" going. No problem, but a few questions
Does this compile only on Windows, or is there any hope of building it on Mac or Linux? I notice the src directory has a version of Daedalus with a bunch of cpp files, some of which seems algorithmic and some of which seem to be interfacing to Windows. At least conceptually, it should be possible to separate the algorithmic bits from the Windows bits (but doing so requires some intentionality on the part of the original programmer, lest Windows dependencies leak all over the rest of the code). Because you're using matplotlib and Python for display, there should be no theoretical reason for dependency on Windows.
If you've built it off Windows, would you happen to have a CMakeLists.txt or makefile?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.