You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Python and libraries on MacBook Pro

I need to add a couple of libraries to run a Python script. I'm a novice. Can you offer a tip or two? Thanks much! - Paul

MacBook Pro 15″, macOS 13.7

Posted on Nov 14, 2024 8:42 AM

Reply
5 replies

Nov 14, 2024 9:00 AM in response to krups79

Are you referring to Apple's Python 3.9 installed by either 1) Xcode or 2) command line tools for Xcode? Or if the former is not installed, what version of Python and installed by what method?


By libraries, are you referring to Python packages (e.g. modules)?


Once I know the answer to the Python version and how you installed it, I would recommend that you visit the Python package sites and confirm that they are compatible with your version of Python. Then the command to install them should be next…

Nov 14, 2024 10:43 AM in response to krups79

Again, check that the modules that you want to install do support Python 3.13 or later. If all good, enter the following command which updates pip and installs the modules whose names you replace below:

/usr/local/bin/pip3 install -U pip mod1name mod2name

Then, you refer to the individual module instructions for how you refer to each in your Python3 script and whether it is as simple as import ___, or from ___ import ___.

Python and libraries on MacBook Pro

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.