Open BrendanJercich opened 2 years ago
Greetings
The only changes that I made regarding building on a mac were bumping some of the python dependency versions. This was a while ago, but IIRC the Pillow version was so old that I was having trouble building / finding wheels on pypi for that package.
https://github.com/michael-lazar/playscii/blame/master/requirements.txt
I'm currently running an M1 mac but I don't see any reason why this shouldn't work on 64-bit too. The installation notes that I wrote here are tailored to my specific environment and your homebrew directories or sdl version numbers might be different from mine.
I remember PYSDL2_DLL_PATH
being a pain in the ass and finicky, and the key was that I had to create symlinks to the .dylib
files and put them in the same directory.
I would double check that whatever your PYSDL2_DLL_PATH
is set to, that directory contains both of these files with these specific names
libSDL2.dylib
libSDL2_mixer.dylib
OKAY! I had to tweak the paths to account for slightly different versions of the SDL libraries, and to account for my Homebrew libraries living in /usr/local/Cellar/
, but after that following the instructions in the notes file actually launched the app from the command line. And I can add things to my virtual environment if I want to use them, too! Thank you very much!
Using Python 3.10, I needed to bump numpy up to 1.21
. The 1.20
version wouldn't build a wheel with Python 3.10. I didn't need to manually install Pillow either. My notes, based off this very helpful guide.
# Install packages needed for the app
brew install sdl2 sdl2_mixer numpy libjpeg libtiff
# Find the paths to the dylib files by running:
brew list sdl2
brew list sdl2_mixer
# Symlink the dylib files into the project directory
# (note: if you ever upgrade the sdl2 libraries the symlinks presumably need to be updated)
ln -s /path/to/libSDL2-2.0.0.dylib libSDL2.dylib
ln -s /path/to/libSDL2_mixer-2.0.0.dylib libSDL2_mixer.dylib
# Change numpy version in `requirements.txt` to something compatible with your Python version.
# For me, numpy==1.21.6 worked fine with Python 3.10.6
# Setup up a virtual environment and install the required packages
python3 -m pip venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run the program, specifying the current directory with symlinked dylib file as the path to the sdl2 libraries
PYSDL2_DLL_PATH=. python playscii.py
# Enjoy!
Leaving this here for the next poor soul with Python 3.10 that's trying to make art for their terminal CLIs 😅
Thanks @michael-lazar !
Commentary on the Itch storefront seems to hint as much: https://itch.io/post/4747062 But I'm having trouble running it on Monterey/12.4. Specifically, I get the same error in response to
python3 playscii.py
on this repo that I do on the main repo from Heptapod, which is:I have no experience with SDL, so I'm fumbling in the dark here, but I have tried setting the PYSDL2_DLL_PATH environment variable to point to (eg) the sdl2dll directory tucked away in python3.9/site-packages in this copy of the code, which doesn't seem to affect anything.
Are you able to run Playscii on 64-bit Mac OS? Have you seen this issue before?