CYGWIN install without pikepdf #169

Closed
opened 11 months ago by axoroll7 · 2 comments

Hello,

I found a way to install img2pdf on CYGWIN (without pikepdf), and I wanted to share, for anyone who come across this issue, searching a solution:

# python39-imaging = Pillow
apt-cyg install python39 python39-pip python39-setuptools python39-wheel python39-imaging
python3.9 -m pip install --upgrade --no-deps img2pdf
hash -r
img2pdf --version

My problems: I try to install img2pdf on CYGWIN, with pip. But Pillow (python39-imaging), QPDF, lxml (python39-lxml), and others are not recognized when I try to install a package which depends on them, and pip try to build them in vain. When I open an interpreter, I can import them, but pip apparently not. I found this solution, but if anyone known the true solution, please share.

EDIT 1: I forgot to add "install" after "apt-cyg"

EDIT 2: I just found out. pikepdf requires "Pillow>=9.0", "lxml>=4.8" and 'QPDF_MIN_VERSION = "11.2.0"'. But they are not updated in the CYGWIN repository. So, if you want to install img2pdf on CYGWIN, or on any distros with outdated dependencies, just make sure Pillow is installed and accessible on the same python version, and install img2pdf without its dependencies.

Maybe, the dependency pikepdf can be marked as "not mandatory" ? I do not known how it could be done in the setup.py file.

EDIT 3: Nevermind. The only way would be to add pikepdf as an optional dependency, which I am sure, is not the best solution, because it could affect negatively most platforms, to only support some platforms.

The solution for some platforms:

pip3 install --upgrade Pillow
pip3 install --upgrade --no-deps img2pdf

It would be good in my opinion if it was written somewhere, in a wiki for example, because the minimal versions required by pikepdf are quite high.

Hello, I found a way to install img2pdf on CYGWIN (without pikepdf), and I wanted to share, for anyone who come across this issue, searching a solution: ```bash # python39-imaging = Pillow apt-cyg install python39 python39-pip python39-setuptools python39-wheel python39-imaging python3.9 -m pip install --upgrade --no-deps img2pdf hash -r img2pdf --version ``` My problems: I try to install img2pdf on CYGWIN, with pip. But Pillow (python39-imaging), QPDF, lxml (python39-lxml), and others are not recognized when I try to install a package which depends on them, and pip try to build them in vain. When I open an interpreter, I can import them, but pip apparently not. I found this solution, but if anyone known the true solution, please share. EDIT 1: I forgot to add "install" after "apt-cyg" EDIT 2: I just found out. pikepdf requires "Pillow>=9.0", "lxml>=4.8" and 'QPDF_MIN_VERSION = "11.2.0"'. But they are not updated in the CYGWIN repository. So, if you want to install img2pdf on CYGWIN, or on any distros with outdated dependencies, just make sure Pillow is installed and accessible on the same python version, and install img2pdf without its dependencies. Maybe, the dependency pikepdf can be marked as "not mandatory" ? I do not known how it could be done in the setup.py file. EDIT 3: Nevermind. The only way would be to add pikepdf as an optional dependency, which I am sure, is not the best solution, because it could affect negatively most platforms, to only support some platforms. The solution for some platforms: ```bash pip3 install --upgrade Pillow pip3 install --upgrade --no-deps img2pdf ``` It would be good in my opinion if it was written somewhere, in a wiki for example, because the minimal versions required by pikepdf are quite high.
Owner

I'm unsure what the best way forward is. Indeed pikepdf is not mandatory and img2pdf will work without it but produce slightly worse output. I'd like to see a solution where pikepdf is still installed by default on the platforms where it's available but make it possible to not install it on the others. Having to use --no-deps is not a good solution. But I also do not like that utilizing EXTRAS_REQUIRE in setup.py would mean that most people would have to run:

pip install img2pdf[full]

The default should be to add pikepdf and it should take extra steps not to have it -- not the other way round. Is this possible somehow with setuptools?

I'm unsure what the best way forward is. Indeed pikepdf is not mandatory and img2pdf will work without it but produce slightly worse output. I'd like to see a solution where pikepdf is still installed by default on the platforms where it's available but make it possible to not install it on the others. Having to use `--no-deps` is not a good solution. But I also do not like that utilizing `EXTRAS_REQUIRE` in `setup.py` would mean that most people would have to run: pip install img2pdf[full] The default should be to add pikepdf and it should take extra steps not to have it -- not the other way round. Is this possible somehow with setuptools?
Poster

I'm unsure what the best way forward is. Indeed pikepdf is not mandatory and img2pdf will work without it but produce slightly worse output. I'd like to see a solution where pikepdf is still installed by default on the platforms where it's available but make it possible to not install it on the others. Having to use --no-deps is not a good solution. But I also do not like that utilizing EXTRAS_REQUIRE in setup.py would mean that most people would have to run:

pip install img2pdf[full]

The default should be to add pikepdf and it should take extra steps not to have it -- not the other way round. Is this possible somehow with setuptools?

@josch

I do not think so. Maybe with some complex programming in the setup.py file ? I think this limitation in pip is wanted by the developers. I think your initial choice of integrating it by default is the best.

I am closing my issue with your agreement.

> I'm unsure what the best way forward is. Indeed pikepdf is not mandatory and img2pdf will work without it but produce slightly worse output. I'd like to see a solution where pikepdf is still installed by default on the platforms where it's available but make it possible to not install it on the others. Having to use `--no-deps` is not a good solution. But I also do not like that utilizing `EXTRAS_REQUIRE` in `setup.py` would mean that most people would have to run: > > pip install img2pdf[full] > > The default should be to add pikepdf and it should take extra steps not to have it -- not the other way round. Is this possible somehow with setuptools? @josch I do not think so. Maybe with some complex programming in the setup.py file ? I think this limitation in pip is wanted by the developers. I think your initial choice of integrating it by default is the best. I am closing my issue with your agreement.
axoroll7 closed this issue 11 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#169
Loading…
There is no content yet.