p5 icon indicating copy to clipboard operation
p5 copied to clipboard

P5 fails to install on M1 Mac

Open weschao opened this issue 3 years ago • 5 comments

MacOS Monterey 12.4, Python 3.10.6

pip3 install p5 fails, with about 2000 lines of errors, ending with:

ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

I suspect the error is that p5 requires numpy 1.18.5, but it looks like M1 support for numpy wasn't introduced until 1.21.

weschao avatar Sep 01 '22 05:09 weschao

Thank you for submitting your first issue to p5py

github-actions[bot] avatar Sep 01 '22 05:09 github-actions[bot]

Workaround: pip install p5 (this will fail; that’s ok) pip install numpy (this installs the latest version) pip install freetype-py glfw pillow pyopengl-accelerate requests skia-python vispy (installs everything that comes after numpy)

weschao avatar Sep 01 '22 16:09 weschao

Can you try installing it from GitHub directly? We have updated the dependency but a release is yet to be made.

tushar5526 avatar Sep 01 '22 19:09 tushar5526

Sure, happy to try. How do I install it from Github, though? The installation instructions link directs me to use pip install.

weschao avatar Sep 01 '22 19:09 weschao

You can clone the repo and do pip install . in the cloned repo directory or you could use pip install git+https://github.com/p5py/p5.git#egg=p5. I would also recommend you to use virtual environments (you can google about it) in python if you are new to it.

tushar5526 avatar Sep 01 '22 20:09 tushar5526

You can clone the repo and do pip install . in the cloned repo directory or you could use pip install git+https://github.com/p5py/p5.git#egg=p5. I would also recommend you to use virtual environments (you can google about it) in python if you are new to it.

Thanks, that was definitely it. I was having all sort of errors trying to install 0.8.0 in Windows, installing p5 through the mentioned command worked.

ahdistefano avatar Oct 15 '22 20:10 ahdistefano

@ahdistefano Yes, we will make the new release soon once some issues for MAC are fixed here. Also, do try the new 2D renderer and feel free to open an issue if you face any bugs!

tushar5526 avatar Oct 15 '22 21:10 tushar5526

thanks! pip install git+https://github.com/p5py/p5.git#egg=p5 works for me on my M1 macOS Ventura MacBook Air

You can clone the repo and do pip install . in the cloned repo directory or you could use pip install git+https://github.com/p5py/p5.git#egg=p5. I would also recommend you to use virtual environments (you can google about it) in python if you are new to it.

Zhu-Aemon avatar Nov 07 '22 07:11 Zhu-Aemon

With the new release, one can just do a pip install p5 now.

tushar5526 avatar Nov 15 '22 06:11 tushar5526