[Tutor] PYTHON INSTALLATION PROBLEM

Richard Damon Richard at Damon-Family.org
Sat Oct 30 09:14:14 EDT 2021


I think you are misunderstanding.

'python' only exists in one place, so the path ordering doesn't matter, 
unless I create new symlinks with the name python as an alias for 
python3.x. This might break some system scripts that depend on python 
2.7, so I just live with using the command python3 to run python3 scripts.

The path does need to be kept up to date so the 'right' python 3.x is 
the python3 command, as each directory gives its executable a name like 
python3.10 and adds a python3 symlink to point to it (which allows me to 
use older versions when I need to).

The OP wasn't using the command line to try to run python, but was 
clicking on the app in the task bar under the apps folder. When doing 
that, why you probably really want is IDLE, not just the plain python 
interpreter.


On 10/30/21 7:10 AM, Bryan O'Brien wrote:
> So /usr/bin precedes your other python installations.   This is expected.   Don't modify /usr/bin/python.  The operating system might depend on its existence.
>
> Rather, pick one of the paths containing python3, and modify your ~/.zshrc - placing this python3  location before /usr/bin.
>
> You'll have to restart the terminal (or source ~/.zshrc) for the path changes to take effect.
>
> FWIW, I've found (on GitHub) the program known as "pyenv" to be invaluable - from a personal perspective.  Might be more than what you need/want, but an excellent python management/installer IMHO.
>
>> On Oct 30, 2021, at 05:54, Richard Damon <Richard at damon-family.org> wrote:
>>
>> Actually, it says I only have 1 'python', but multiple 'python3'
>> /usr/bin/python symlinks to a version 2.7 off in /System/Library/Frameworks/
>>
>> All the versions 3.x only appear as python3 or python3.x
>>
>> It could well be that they haven't fully removed python2.7 dependencies from the system (or maybe better, haven't validated that they have) so python means python2 for backwards compatibility.
>>
>>
>>> On 10/29/21 11:31 PM, Bryan O'Brien wrote:
>>> Likely, you have multiple Python executables on your system.
>>> This will necessitate modifying your PATH.
>>>
>>> In terminal, run:
>>>
>>> which -a python <enter>
>>>
>>> If multiple python versions exist (this is normal with MacOS), just ensure that the python you want to use is listed first in your path.
>>>
>>> grep -i path ~/.zshrc
>>>
>>> HTH
>>>
>>>>> On Oct 29, 2021, at 22:00, Richard Damon <Richard at damon-family.org> wrote:
>>>> On 10/29/21 8:08 PM, Cameron Simpson wrote:
>>>>>> On 29Oct2021 19:51, Richard Damon <Richard at Damon-Family.org> wrote:
>>>>>> On the Mac, 'Python Launcher' seems to just configure how python will
>>>>>> run programs run under python. Generally from the Dock, you will want
>>>>>> to click on the 'IDLE' icon, which launches the Python IDE, which gives
>>>>>> and editor to write python programs or load a python script.
>>>>>> The other way to run python is from the command line, using a command
>>>>>> like python3 myprog.py
>>>>> Also, Macs ship with Python. If your MacOS is current, the supplied
>>>>> Python should be pretty modern.
>>>>> Cheers,
>>>>> Cameron Simpson <cs at cskk.id.au>
>>>> You might think that, but my Mac, running the latest version of OS-X, Monterey, reports for a "python --version"  that the system default python is still 2.7.10
>>>>
>>>> Now, this system is a 2019 Year model, but was built as a upgrade to an older system. so that might be a reason.
>>>>
>>>> Since I have been manually installing current Pythons, I don't know if they also have provided a python3 command with something more recent.
>>>>
>>>> -- 
>>>> Richard Damon
>>>>
>>>> _______________________________________________
>>>> Tutor maillist  -  Tutor at python.org
>>>> To unsubscribe or change subscription options:
>>>> https://mail.python.org/mailman/listinfo/tutor
>>> _______________________________________________
>>> Tutor maillist  -  Tutor at python.org
>>> To unsubscribe or change subscription options:
>>> https://mail.python.org/mailman/listinfo/tutor
>>
>> -- 
>> Richard Damon
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


-- 
Richard Damon



More information about the Tutor mailing list