Closed HTGAzureX1212 closed 4 years ago
In addition I have also tried to use the '--disable-zlib' flag to disable, however that threw me an error that the option '--disable-zlib' is not recognised.
Why was this closed? I'm running into the same issue.
OK, found it... for some reason (https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000530279-unable-to-upgrade-the-pip-version-) the pip command that IntelliJ calls uses an older pip. Had to open terminal and issue instead:
python -m pip install Pillow
Now it found the binaries, and didn't try to compile.
I tried the -python pip install Pillow and pillow still does not load. my pip is 19.0.3-py3.8.egg in venv/lib
@Don-Odom Please could you open a new issue with more details?
Sorry. I am new to python. I am learning by trying to create a game. The game will require reading a jpg and inserting it into an excel spreadsheet. needing to read an image I tried 'PIL import Image', but got
Traceback (most recent call last):
File "C:/Users/Don/PycharmProjects/POKENO/POKENO Cards.py", line 35, in <module>
with open(pic, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '48C.jpg'
Assuming i needed to install Pillow, since neither Pil or Pillow are installed I entered the following and got error 1
(venv) C:\Users\Don\PycharmProjects\POKENO\venv\Scripts>python -m pip install Pillow
Collecting Pillow
Using cached https://files.pythonhosted.org/packages/c7/04/c91bb0e495c1e8a09633ecb061fab32e276ace7cefcef5d12334cdd14cd2/Pillow-7.1.1.tar.gz
Installing collected packages: Pillow
Running setup.py install for Pillow ... error
Complete output from command C:\Users\Don\PycharmProjects\POKENO\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Don\\AppData\\Local\\Temp\\pip-install-tmr8lqru\\Pillow\\setup.p
y';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Don\AppData\Local\Temp\pip-record-he2phuy1\install-reco
rd.txt --single-version-externally-managed --compile --install-headers C:\Users\Don\PycharmProjects\POKENO\venv\include\site\python3.8\Pillow:
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ContainerIO.py -> build\lib.win32-3.8\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ExifTags.py -> build\lib.win32-3.8\PIL
copying src\PIL\features.py -> build\lib.win32-3.8\PIL
copying src\PIL\FitsStubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\FontFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\GdImageFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\Image.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageChops.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageCms.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageColor.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageDraw.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageFilter.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageFont.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageGrab.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageMath.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageMode.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageMorph.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageOps.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImagePalette.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImagePath.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageQt.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageSequence.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageShow.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageStat.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageTk.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageTransform.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageWin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\JpegPresets.py -> build\lib.win32-3.8\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PaletteFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PdfParser.py -> build\lib.win32-3.8\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PSDraw.py -> build\lib.win32-3.8\PIL
copying src\PIL\PyAccess.py -> build\lib.win32-3.8\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\TarIO.py -> build\lib.win32-3.8\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\TiffTags.py -> build\lib.win32-3.8\PIL
copying src\PIL\WalImageFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\_binary.py -> build\lib.win32-3.8\PIL
copying src\PIL\_tkinter_finder.py -> build\lib.win32-3.8\PIL
copying src\PIL\_util.py -> build\lib.win32-3.8\PIL
copying src\PIL\_version.py -> build\lib.win32-3.8\PIL
copying src\PIL\__init__.py -> build\lib.win32-3.8\PIL
copying src\PIL\__main__.py -> build\lib.win32-3.8\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'azure-pipelines.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching '.ci'
writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
running build_ext
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
Traceback (most recent call last):
File "C:\Users\Don\AppData\Local\Temp\pip-install-tmr8lqru\Pillow\setup.py", line 860, in <module>
setup(
File "C:\Users\Don\PycharmProjects\POKENO\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\__init__.py", line 145, in setup
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Don\PycharmProjects\POKENO\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\command\install.py", line 61, in run
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Don\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\Don\AppData\Local\Temp\pip-install-tmr8lqru\Pillow\setup.py", line 694, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Don\AppData\Local\Temp\pip-install-tmr8lqru\Pillow\setup.py", line 914, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
----------------------------------------
Command "C:\Users\Don\PycharmProjects\POKENO\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Don\\AppData\\Local\\Temp\\pip-install-tmr8lqru\\Pillow\\setup.py';f=getattr(tokenize, '
open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Don\AppData\Local\Temp\pip-record-he2phuy1\install-record.txt --single-version-
externally-managed --compile --install-headers C:\Users\Don\PycharmProjects\POKENO\venv\include\site\python3.8\Pillow" failed with error code 1 in C:\Users\Don\AppData\Local\Temp\pip-install-tmr8lqru\Pillow\
(venv) C:\Users\Don\PycharmProjects\POKENO\venv\Scripts>
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
https://pillow.readthedocs.io/en/stable/installation.html#windows-installation
@Don-Odom That pip (19.0.3) is too old. If you do this from under PyCharm, probably the cleanest solution is to open the PyCharm terminal, and force PyCharm to use a new version like this (you should do this with active virutalenv, but that's how PyCharm terminal is opened by default anyway):
python -m pip install -U --force-reinstall pip
Then restart PyCharm (or at least the project). Now for that project it should use pip 20.x.x (or later), even if you install dependencies via the GUI.
Do you handle issues with openpyxl. I am having a problem with wb.save. my program ends with the following
"C:\Users\Don\PycharmProjects\Test 2\venv\Scripts\python.exe" "C:/Users/Don/PycharmProjects/Test 2/Test 2.py"
Traceback (most recent call last):
File "C:/Users/Don/PycharmProjects/Test 2/Test 2.py", line 20, in
wb.save('POKENO Cards new.xlsx')
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\workbook\workbook.py", line 392, in save
save_workbook(self, filename)
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\writer\excel.py", line 293, in save_workbook
writer.save()
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\writer\excel.py", line 275, in save
self.write_data()
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\writer\excel.py", line 75, in write_data
self._write_worksheets()
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\writer\excel.py", line 218, in _write_worksheets
self._write_drawing(ws._drawing)
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\writer\excel.py", line 141, in _write_drawing
self._archive.writestr(drawing.path[1:], tostring(drawing._write()))
File "C:\Users\Don\PycharmProjects\Test 2\venv\lib\site-packages\openpyxl\drawing\spreadsheet_drawing.py", line 295, in _write
self._rels.append(rel)
UnboundLocalError: local variable 'rel' referenced before assignment
Process finished with exit code 1
Here is my program.
import openpyxl as xl
from PIL import Image
from openpyxl.workbook import Workbook
wb = xl.load_workbook('POKENO Cards.xlsx', data_only=False) im = Image.open(r"C:/Users/Don/PycharmProjects/Test 2/Playing Cards/2C.jpg") ws = wb['Sheet1']
im.show() newimg = im.resize((78, 100)) newimg.show() newimg.anchor = 'A4' ws.add_image(newimg) wb.save('POKENO Cards new.xlsx')
From: Hugo van Kemenade [mailto:notifications@github.com] Sent: Sunday, April 05, 2020 2:27 PM To: python-pillow/Pillow Cc: Don-Odom; Mention Subject: Re: [python-pillow/Pillow] Failure of 'pip install Pillow==7.0.0' (#4456)
@Don-Odom https://github.com/Don-Odom Please could you open a new issue with more details?
https://github.com/python-pillow/Pillow/issues/new/choose
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/python-pillow/Pillow/issues/4456#issuecomment-609469118 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APCHO26ZCTZ3PYUTJI4WQ3TRLDLP3ANCNFSM4K6OJEVQ . https://github.com/notifications/beacon/APCHO2YLU3HCBFUAZEJ4QVDRLDLP3A5CNFSM4K6OJEV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOERJ4FPQ.gif
No, openpyxl issues go to https://stackoverflow.com/ or https://bitbucket.org/openpyxl/openpyxl
It's only about reinstall PIP and then PILLOW Run this command first
python -m pip install -U --force-reinstall pip
and run
python -m pip install Pillow
Only way in my case to fix this issue with python 3.8 was to install https://www.anaconda.com/products/individual, and create new project with conda venv and run conda install -c anaconda pillow. I tried everything i found on internet with pip. Conda was the only way for me and installation of pillow runs without any problem.
What did you do?
I executed 'pip install Pillow==7.0.0' in the built-in terminal of my PyCharm Professional Project.
What did you expect to happen?
The installation of Pillow should be successful.
What actually happened?
Instead, it threw me an error that the required dependency 'zlib' is missing.
What are your OS, Python and Pillow versions?