Ex 46 - Project Skeleton: Installing virtualenv

I’m working on Ex. 46 of Learn Python 3 the Hard Way.

When I input “pip3.6” list I get the following:
Last login: Mon Jun 21 10:16:59 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
HAROLDs-MacBook-Pro:~ haroldmathews$ cd Documents/Hello
HAROLDs-MacBook-Pro:Hello haroldmathews$ pip3.6 list
-bash: pip3.6: command not found
HAROLDs-MacBook-Pro:Hello haroldmathews$ pip3.9 list
Package Version


pip 20.2.3
pydealer 1.4.0
pygame 2.0.1
setuptools 49.2.1
WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
You should consider upgrading via the ‘/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install --upgrade pip’ command.
HAROLDs-MacBook-Pro:Hello haroldmathews$ /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install --upgrade pip
Collecting pip
Downloading pip-21.1.2-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 2.7 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-21.1.2
HAROLDs-MacBook-Pro:Hello haroldmathews$

When I tried 3.6 I got:
-bash: pip3.6: command not found
That’s when I discovered I had Version 3.9. How did that happen?

So, when I input “pip3.9 list” I found out my pip version was out of date. Fortunately, Iwas able to upgrade to 21.1.2.

Next I tried "sudo pip3.6 install virtualenv"and I was asked for a password. I have no idea how to respond. Can you help me?

Hi, a number of things going on here. In reverse order, the request for password was because you used sudo which requests to perform the action with special privileges (super user do). This can be a bit dangerous if your not sure what you’re doing but in your example, it only installing pip.

You’ll find that pip version warning frequently, as it’s has incremental version updates all the time. I tend to ignore it until I’ve got some free time to read about the changes. You can disable it but it’s not worth the hassle.

Regarding the python version, when did you install 3.6? Are you sure you did? Or did you install python from the latest version from python.org? Which would be 3.9. Is there a python 3.6 and 3.9 folder in your Applications folder?

What is the message when you enter which python into terminal? I expect it to be 3.9.

I believe I installed Python 3.6 on December 7, 2020. My Application Folder contains the license and Install certificates dated 12/7/20. But my Python Folder is dated 1/12/21 and it shows only Python 3.9, so I may have inadvertently updated Python without knowing it. I’m pretty sure I chose 3.6 initially, because I was advised that 3.9 had stability issues at the time.

If you echo $PATH it will show you all the locations in your path. I wonder if python 3.6 shows at all in any directories.

It’s quite hard to update python by accident really unless you’re messing about with Anaconda base version.

1 Like

I ran echo $PATH, and only Python3.9 showed up. So I guess I was using 3.9 all along. Thanks for your help.

1 Like

No problem @Thumper1

3.9 is actual quite stable now anyway so should see you through for a while.