Hi i have just tried to run your code using Pillow 5.1, without luck
┌<▸> ~/g/Black-hole-simulation-using-python
└➤
pip install -r requirements.txt
Requirement already satisfied: numpy>=1.14 in /usr/local/anaconda3/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (1.24.3)
Requirement already satisfied: matplotlib>=3.1 in /usr/local/anaconda3/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (3.7.1)
Requirement already satisfied: scipy>=1.1 in /usr/local/anaconda3/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (1.11.1)
ERROR: Could not find a version that satisfies the requirement PIL>=5.1 (from versions: none)
ERROR: No matching distribution found for PIL>=5.1
I have Pillow 9.4.0, so do i have to downgrade?
┌<▸> ~/g/Black-hole-simulation-using-python
└➤
pip install Pillow==5.1
Collecting Pillow==5.1
Downloading Pillow-5.1.0.tar.gz (14.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.3/14.3 MB 4.4 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: Pillow
Building wheel for Pillow (setup.py) ... done
Created wheel for Pillow: filename=Pillow-5.1.0-cp311-cp311-macosx_10_9_x86_64.whl size=462690 sha256=f2e4faf891e91b33565f6fad427b461b9beacabb822ad0e614d0ea450011b4c7
Stored in directory: /Users/aironman/Library/Caches/pip/wheels/90/8f/90/401a3b33bdfc4ffc28443b3ec2d54766c682523e95e2693658
Successfully built Pillow
Installing collected packages: Pillow
Attempting uninstall: Pillow
Found existing installation: Pillow 9.4.0
Uninstalling Pillow-9.4.0:
Successfully uninstalled Pillow-9.4.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
matplotlib 3.7.1 requires pillow>=6.2.0, but you have pillow 5.1.0 which is incompatible.
bokeh 3.2.1 requires pillow>=7.1.0, but you have pillow 5.1.0 which is incompatible.
scikit-image 0.20.0 requires pillow>=9.0.1, but you have pillow 5.1.0 which is incompatible.
imageio 2.31.1 requires pillow>=8.3.2, but you have pillow 5.1.0 which is incompatible.
Successfully installed Pillow-5.1.0
<▸> ~/g/Black-hole-simulation-using-python
└➤
pip install -r requirements.txt
Requirement already satisfied: numpy>=1.14 in /usr/local/anaconda3/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (1.24.3)
Requirement already satisfied: matplotlib>=3.1 in /usr/local/anaconda3/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (3.7.1)
Requirement already satisfied: scipy>=1.1 in /usr/local/anaconda3/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (1.11.1)
ERROR: Could not find a version that satisfies the requirement PIL>=5.1 (from versions: none)
ERROR: No matching distribution found for PIL>=5.1
┌<▪> ~/g/Black-hole-simulation-using-python
└➤
pip list | grep Pillow
Pillow 5.1.0
┌<▸> ~/g/Black-hole-simulation-using-python
└➤
python black_hole.py
Openning /Users/aironman/git/Black-hole-simulation-using-python/images/milkyway.jpg
Traceback (most recent call last):
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 1013, in
blackhole = BlackHole()
^^^^^^^^^^^
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 49, in init
self.open(img_name, size=self.axe_X)
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 143, in open
self.img_original = Image.open(img_name, mode='r')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/PIL/Image.py", line 2559, in open
preinit()
File "/usr/local/anaconda3/lib/python3.11/site-packages/PIL/Image.py", line 376, in preinit
from . import JpegImagePlugin
File "/usr/local/anaconda3/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 41, in
from . import Image, ImageFile, TiffImagePlugin
File "/usr/local/anaconda3/lib/python3.11/site-packages/PIL/TiffImagePlugin.py", line 400, in
class ImageFileDirectory_v2(collections.MutableMapping):
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'MutableMapping'
┌<▸> ~/g/Black-hole-simulation-using-python
└➤
pip uninstall Pillow
Found existing installation: Pillow 5.1.0
Uninstalling Pillow-5.1.0:
Would remove:
/usr/local/anaconda3/lib/python3.11/site-packages/Pillow-5.1.0.dist-info/*
Proceed (Y/n)? Y
Successfully uninstalled Pillow-5.1.0
┌<▪> ~/g/Black-hole-simulation-using-python
└➤
pip install pillow
Collecting pillow
Obtaining dependency information for pillow from https://files.pythonhosted.org/packages/07/22/93d6b5aa5917d09ec7088a2c4d1821848f3f95fbdc2633ba9d9fc28444a1/Pillow-10.1.0-cp311-cp311-macosx_10_10_x86_64.whl.metadata
Using cached Pillow-10.1.0-cp311-cp311-macosx_10_10_x86_64.whl.metadata (9.5 kB)
Using cached Pillow-10.1.0-cp311-cp311-macosx_10_10_x86_64.whl (3.5 MB)
Installing collected packages: pillow
Successfully installed pillow-10.1.0
┌<▸> ~/g/Black-hole-simulation-using-python
└➤
python black_hole.py
Openning /Users/aironman/git/Black-hole-simulation-using-python/images/milkyway.jpg
Traceback (most recent call last):
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 1013, in
blackhole = BlackHole()
^^^^^^^^^^^
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 49, in init
self.open(img_name, size=self.axe_X)
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 149, in open
self.img_debut = self.img_resize(size)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/aironman/git/Black-hole-simulation-using-python/black_hole.py", line 167, in img_resize
self.img_debut = self.img_debut.resize((axe_X, axe_Y), Image.ANTIALIAS)
^^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'
So, i need Pillow >=5.1 but bellow 10.1.0...