-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip error: "The headers or library files could not be found for jpeg" #5042
Comments
These libraries are listed in the macOS installation from source instructions linked in the error message: https://pillow.readthedocs.io/en/stable/installation.html#building-on-macos However, this shouldn't be necessary, since Pillow does provide pre-built wheels for macOS: https://pypi.org/project/Pillow/#files ( Are you using one of the new Apple Silicon Macs? |
No, macbook pro 2016 intel i7 |
It's a packaging issue, I'm not sure if the PIP or Pillow is to blame. both are responsible. |
What version of pip do you have? Does it help to upgrade it? We also recommend running If it doesn't help, please can you post the full verbose output of |
@hugovk- Big sur clean installation, everything is the latest version. Latest python3 installed with brew.
|
Thanks, what do you get when running this? python3 -m pip install Pillow -v |
I got 683 KB, 1986 lines output. I don't want to paste it here. Last two lines;
|
If you don't want to paste it here, please could you upload it as a zip file or to https://gist.github.com/ or pastebin? The reason I ask is because it might help us find out why it's not installing a prebuilt binary wheel and is attempting to build from source. There should be stuff like this, showing in my case that it found
But wait!
Looks like it's working now? |
PIP installs package but Image module fails without
|
This comment has been minimized.
This comment has been minimized.
https://pillow.readthedocs.io/en/stable/installation.html#building-from-source |
libjpeg is not the default in the operating system, but the default for Pillow. I hate ad hominem developers. |
Please don’t be rude to the developers trying to help you on a platform released within the last week. |
This comment has been minimized.
This comment has been minimized.
Having just upgraded to Big Sur and trying to install Pillow into Python 3.6 using pip, I also see that the binary wheels are not being recognised. Looking around, this seems to be a wider problem than just Pillow.
pypa/packaging#319 is a potential solution. |
Refer to this comments: |
pypa/packaging#319 has now been merged. Testing again, I find that pip now installs using the binary. @hazarek if you are interested in trying again, I think you might also find that the binary wheel is detected, meaning that it should now successfully install on your machine? |
i will try tonight |
|
Doesn't appear to be detected on the M1 Silicone Macs...?
|
Any solution for error above for M1 Mac installation? |
@bschollnick You probably don't want to compile, you probably want there to be a wheel… @eashishkalra Traceback? @python-pillow/pillow-team Maybe we just need to leave one of these "headers or library files" issues opened permanently … and then paste in links to other more relevant issues … e.g. "wheels for M1 macs" ? |
|
I think that was one of the inspirations for the new Discussions feature, as in most cases installation is not really an "issue" in Pillow (although it is in some cases). |
#5093 is for the new M1 Macs, please can you try the suggestions at #5093 (comment)? |
We could try that, and maybe lock and pin it, but I think people often find other issues via search. The M1 issue is currently 3rd in the issue list, so not that hard to find if browsing, not searching. I'll pin that too. And we probably will need some M1 changes for the next release. |
This comment has been minimized.
This comment has been minimized.
I have the same issue: Python 3.9, Big Sur, Intel.
@hugovk, here's output.txt After running brew install libjpeg
brew install freetype
pip uninstall Pillow
pip install Pillow it got installed, however, produced an error: Traceback (most recent call last):
File "/Users/rocky/dev/py/jpoetry/jpoetry/image.py", line 11, in <module>
font = ImageFont.truetype("hanZi.ttf", 50)
File "/Users/rocky/.local/share/virtualenvs/name-hash//lib/python3.9/site-packages/PIL/ImageFont.py", line 852, in truetype
return freetype(font)
File "/Users/rocky/.local/share/virtualenvs/name-hash//lib/python3.9/site-packages/PIL/ImageFont.py", line 849, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/Users/rocky/.local/share/virtualenvs/name-hash//lib/python3.9/site-packages/PIL/ImageFont.py", line 185, in __init__
if core.HAVE_RAQM:
File "/Users/rocky/.local/share/virtualenvs/name-hash//lib/python3.9/site-packages/PIL/ImageFont.py", line 44, in __getattr__
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed If I switch back to Python 3.8 it installs and works flawlessly. Any suggestions how to fix it on 3.9? Solutionturns out I had old pip version in my venv, updating it solved the issue. |
nice. It's work for my Mac M1 |
|
Brand new Macbook off the shelf: MacOS Big Sur 11.2.3
Thanks to everyone who participated in this thread ❤️ |
That works for me too... MacBook air M1 2020. Give it a try. Trust me |
on alpine I had to run |
This works for me, MacBook Air M1 2020, thanks. |
On MacOS Montery, installing |
Fails for me during my Github Action workflow to build the wheel of my library: https://github.com/ToFuProject/tofu/actions/runs/3265080608/jobs/5366784038
@nulano , any idea how to fix it for github Actions ? This is preventing me from releasing a new version... |
@Didou09 If building from source, make sure you have the non-Python dependencies installed. See https://pillow.readthedocs.io/en/stable/installation.html#building-from-source If that doesn't help, please create a new issue. (And we no longer support Python 3.6, it's EOL since last year.) |
What did you do?
pip3 install Pillow
What did you expect to happen?
installing the package properly without the hassle.
What actually happened?
What are your OS, Python and Pillow versions?
I was able to install after a short search engine research
brew install libjpeg
pip3 install Pillow
The text was updated successfully, but these errors were encountered: