purepng
purepng copied to clipboard
Pip and setup.py fails to install
I've tried installing this using both pip install
and python setup.py install
from the extracted copy from the zip file downloaded by pip and both failed to install PurePNG. I know nothing when it comes to installing so I've attached copied text from the command prompt windows for both situations, using the highest verbosity in the pip scenario.
Command_Prompt_setup.py.txt
Command_Prompt_pip.txt
Footnote: the package that this is forked from, pypng, installs just fine
Seems some broken about compilation.
Try this setup.py https://raw.githubusercontent.com/Scondo/purepng/any_compile/setup.py
I can reproduce this on my Mac when installing from PyPI:
pip uninstall -y purepng
env CC=/usr/bin/false pip install --no-cache-dir --upgrade --verbose purepng
But not when installing from a local clone:
pip uninstall -y purepng
env CC=/usr/bin/false pip install --no-cache-dir --upgrade --verbose ~/Documents/Code/purepng
It seems to skip the build_ext step. I have no clue why. Installing from a locally built sdist has the same effect.
It seems you have no Cython installed.
Error appears when you try to compile pre-cythonized pngfilters.c and have compilation environment which is not able to compile python modules at all (Python.h is absent). This surprisingly result in non-compilation errors like [WinError 2] The system cannot find the file specified
There are two ways to resolve this bug: or do not provide pre-cythonized pngfilters.c or (any_compile branch) skip through any error during compilation.
I'm not sure which one is best.
Anyway I'll change logging level to be clean that compilation is optional before next release. https://github.com/Scondo/purepng/blob/master/setup.py#L52
Thanks. I can reproduce it from a clone with Cython installed.
This may be because I'm not familiar with Cython, but build_ext_optional
doesn't seem to be hooked up. So making the try/except more general (any_compile branch) has no effect. Adding print statements in build_ext_optional.build_extension
does not produce output when running setup.py
.
Adding the following makes things work (even without making the try/except more general):
import distutils
distutils.command.build_ext.build_ext = build_ext_opt
I've tried to found more gentle way, but after all use @brechtm way. https://github.com/Scondo/purepng/commit/fb5b8305f0cb24290c157e2d893951d699f74073
Check 0.2.0