question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Near impossible to get started with Python on macOS

See original GitHub issue

Is your feature request related to a problem? Please describe. I received an email from my brother who’s not a developer.

There is something wrong with developers.

I found a great Python script on a forum, where they said you just have to install Python 3.7+ and Pillow (pip install pillow) and voila.

If only it was that simple! I spent four hours trying to get it to work – installing, searching, reading question after question on Stack Overflow, without finding a good answer to something as simple as: How to get a Python 3 script to run on macOS.

Even after having installed Python 3 with the official Mac installer, macOS insists on using Python 2 (which was officially deprecated a few days ago). The answers point to all different directions, with everyone being so assertive and nobody able to agree.

In the end I found a blog post by a Red Hat guy who had struggled with the same problem. Even he thought he had found the best solution, until a Python guru suddenly appears out of the blue with what actually is the best solution, one that apparently only he and other Python gurus knows about. And when I tried that, it worked at once!

I find it incredible that in 2020, you can download an official Python installer for macOS, which won’t work, won’t inform you that it won’t work, and won’t say what you should do to make it work.

Describe the solution you’d like Don’t expect people to magically understand all this. At least inform on the website what additional steps are needed before you can start using Python 3 on macOS. Ideally, fix the installer for macOS – include pyenv or something equivalent.

Describe alternatives you’ve considered Stop recommending Python to new developers.

Additional context I’m a developer myself and would’ve known to look for a version management tool, something I’m familiar with from Ruby and Node. We developers take knowledge like that for granted, but everyone’s not like us. It’s easy to forget that we’re the weird ones, living in a bubble. It should be easy for others to join that bubble, not a struggle.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ned-deilycommented, Feb 7, 2020

Thanks for the report. I think the main issue here is the continuing confusion between Python 2 and Python 3 command names and scripts, something not unique to macOS installations of Python. The confusion here could have been avoided by better documentation of the differences between using the command nanespython, python2, and python3 and similarly pip, pip2, and pip3. Yes, use of virtual environments is one way to avoid the differences, in that an active Python 3 virtual environment provides a python and pip alias to the Python 3 versions. But use of a virtual environment isn’t necessary in situations like this; all that is required is ensuring that you are using the instance of pip that is associated with the instance of Python in use. If one is invoking python with python3 then usually there will be a corresponding pip3 (likewise, for example, python3.8 and pip3.8):

pip3 install pillow

But, even better, you can avoid any ambiguity by invoking pip via the python command line:

python3 -m pip install pillow

Unfortunately, our documentation in this area lags somewhat. With the retirement of Python 2, there are some on-going efforts to improve the docs but there is still much to be done.

1reaction
mwichmanncommented, Apr 21, 2020

This isn’t going to help anyone except to provide a bit of comic relief… apparently getting it working on Mac is a challenege everywhere: https://xkcd.com/1987/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Programming on MacOS: Get Started QUICK and EASY!
Open the MacOS Terminal application found in the applications folder. · Type the command python3 --version in order to confirm that Python is...
Read more >
5. Using Python on a Mac — Python 3.11.1 documentation
Your best way to get started with Python on macOS is through the IDLE integrated development environment, see section The IDE and use...
Read more >
How to use Python on a Mac: Learn coding with ease | Macworld
Learn to code in Python on a Mac with our guide to installation, setup and training courses.
Read more >
Guide for Starting Python Coding on a MacBook
Now is the time to install Python on your MacBook. Some laptops already contain Python, so you should first check in the Terminal...
Read more >
How to Install and Properly Set Up Python 3 - YouTube
2021 Mac OSX Set up: Brew, Python3, pipenv, Pycharm · 30 Mac / macOS Getting Started Tips! Do you know them all?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found