(Mar-02-2022, 02:28 PM)snippsat Wrote: Look at The right and wrong way to set Python 3 as default on a Mac(Mar-02-2022, 02:02 PM)rudeoil18 Wrote: I installed Python 3.10.2 and installed Pillow using Homebrew...but I feel like I didn't do it correctly and have had a tough time uninstalling/reinstalling and think I've kind of messed it up.You most test thepython
andpip
work correctly from command line.
Also there can be be a difference with withpython,
python3
andpip
,pip3
.
Here a quick run on Windows the command is same on Mac.
So thewhich python
andpip --version
most point to same version.
Then willpip install something
install to this version and if just typepython
(start interactive interpreter) can test that install did work
G:\div_code λ python --version Python 3.10.0 G:\div_code λ which python /c/python310/python G:\div_code λ pip --version pip 21.3.1 from C:\python310\lib\site-packages\pip (python 3.10) G:\div_code λ pip install pillow --upgrade Requirement already satisfied: pillow in c:\python310\lib\site-packages (9.0.1) G:\div_code λ python Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from PIL import Image >>> >>> im = Image.open('task.jpg') >>> im.show()Can also usepy
G:\div_code λ py --list Installed Pythons found by py Launcher for Windows -3.10-64 * -3.9-64 -3.7-32 -3.6-32 -3.4-32 -2.7-32*
show the lasted version found.
Sopy
will always use the lasted version found,even if OS path is messed up.
G:\div_code λ py --version Python 3.10.0 G:\div_code λ py -m pip --version pip 21.3.1 from C:\Python310\lib\site-packages\pip (python 3.10
So these are the returns that I get:
user@user-MacBook-Pro-16 ~ % pip3 --version
pip 22.0.3 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)
user@user-MacBook-Pro-16 ~ % python3 --version
Python 3.9.10
user@user-MacBook-Pro-16 ~ % python --version
Python 2.7.18
user@user-MacBook-Pro-16 ~ % pip --version
zsh: command not found: pip
I installed Pillow using homebrew (brew install Pillow) and it seems the installation occurred correctly.
However, I am still getting the error from Pycharm:
/usr/bin/python2.7 "/Users/user/Library/Mobile Documents/com~apple~CloudDocs/NFTs/Wasted/render.py"
Traceback (most recent call last):
File "/Users/user/Library/Mobile Documents/com~apple~CloudDocs/NFTs/Wasted/render.py", line 1, in <module>
from PIL import Image
ImportError: No module named PIL