Questions tagged [python]

General usage of any python tool and running scripts and Apple specific questions are on topic here. Detailed languag-specific questions about programming (where it won’t matter if python runs on any os) belong on Stack Overflow.

Filter by
Sorted by
Tagged with
0 votes
0 answers
177 views

Cannot run Python script using IDLE 3.9 from Finder

When I try to run a Python script I have from Finder, I get the following error (see image): Anyone have any ideas what is going on with this? Thank you!
Jake S's user avatar
  • 1
1 vote
2 answers
2k views

Set python version on MacOS Big Sur [closed]

does someone had situation when "python --version" says "Python 2.7.16", but installed version is 3.7 Command "pyenv versions" says "* 3.7.11 (set by /Users/dima/....
D.K.'s user avatar
  • 113
1 vote
1 answer
95 views

How can I get .py text documents to show up in recents?

While recent .txt and .rtf documents show up in Finder's Favorites "recents", my .py plain text documents (Python scripts) never do, and that's by far the most common file type I need to ...
uhoh's user avatar
  • 1,420
0 votes
1 answer
372 views

Byobu not working on new installation of macOS

I am trying to migrate from Linux to macOS, but apparently byobu is not working out-of-the-box on my machine. The Fn keys partially work. I can see the error message "no previous windows" ...
asdf's user avatar
  • 101
0 votes
2 answers
2k views

What version of python is the one that I cannot uninstall

I installed python (newer version than the one shipped with my machine) and it seems to work. I looked at pip, got confused and now I am not sure if I messed up. When I execute python --version I get ...
Alexander's user avatar
0 votes
0 answers
4k views

Python 3.9 module 'serial' has no attribute 'Serial'

I am not sure if this is a Mac or Python issue, but on Python 3.9.6 if I import serial I get an error:- >>> import serial >>> x=serial.Serial() Traceback (most recent call last): ...
Milliways's user avatar
  • 7,738
1 vote
0 answers
275 views

How can I stop the macOS firewall from blocking Django server (Python)?

For several years I have been regularly using Python's Django framework and running its web server for development purposes on my local machine. I took a break over the past year and am now returning ...
stackunderflow's user avatar
7 votes
4 answers
30k views

M1 mac mini: Python reports `mach-o, but wrong architecture`

We've rented a M1 Mac Mini at a Cloud provider and installed python3 via homebrew. However, when installing packages, we see many errors reporting wrong architecture mismatches. pip3 install <...
pat-s's user avatar
  • 183
0 votes
0 answers
265 views

Install an app from a simple little Makefile?

I have a simple little application written in Python that I mostly use on Linux, but I'd like to get it going on macOS too. On Linux I have a Makefile to install it - it's not an rpm or a deb or ...
dstromberg's user avatar
1 vote
1 answer
796 views

Accessing URL from Chrome and Safari goes well but terminal encounters `curl: (52) Empty reply from server`, what do I do?

This python flask code hosts a simple web service app = Flask(__name__) @app.route('/login', methods=['POST', 'GET']) def login(): if request.method == 'POST': user = request.form['nm'] ...
JJJohn's user avatar
  • 151
0 votes
1 answer
3k views

How to Uninstall Python 3.6 safely and let 3.9 remain installed on my Mac big Sur especially the carshes

Recently my Mac got updated to Big Sur and Pycharm and Python idle have stopped working : both crash. I have read Google but want a sure shot way to uninstall 3.6 and have only 3.9 remain installed. ...
Mona's user avatar
  • 1
1 vote
0 answers
501 views

Automator Quick Action / Workflow has no permission to open files

I'm creating a Quick Action in Automator to replace the default screenshot functionality on Mac as following: Take screenshot Pass screenshot path to Python shell script Have that script upload it to ...
Mika's user avatar
  • 11
0 votes
1 answer
71 views

cannot use the mac_alias package to generate an alias

I have about 3000 files and I need to turn them into aliases so doing it by hand is not an option plus in the future I want to be able to do this automatically. I'm trying to use this package https://...
bobsmith76's user avatar
1 vote
0 answers
99 views

Multiple Jupyter recommended?

I was having some trouble with Jupyter not being able to locate python packages which lead me to find out that I am having 2 installations of it : one in /usr/local and one through homebrew. Is it ...
asymptoticallyboundedgluon's user avatar
3 votes
2 answers
4k views

How to use Spyder keyboard shortcuts with Mac OS

I'm using the Spyder IDE to do Python development on macOS. This IDE provides some keyboard shortcuts I'm used to from other platforms, especially F9 for running a line or selection of lines of codes....
Sympa's user avatar
  • 141
1 vote
0 answers
874 views

Upgrade of Python 3.9 with homebrew fails on High Sierra 10.13.6

I'm obligated to upgrade my python on my brew installation so that I can upgrade many other software packages. Every time brew tries to make python (does from source), it gets stuck on make for days, ...
bento's user avatar
  • 101
1 vote
0 answers
804 views

esptool.py fail to install on mac

I'm trying to use esptool.py to flash ESP32. Since I use Arduino IDE I assume it is installed and work correctly. But since I need to work using command line I encounter problems regarding python2.7 ...
guyd's user avatar
  • 253
0 votes
1 answer
130 views

Anaconda Navigator broken: Can I still access my Jupyter notebooks, created through AN?

Recently I needed to clear space of my Mac (OS Catalina), and made the (foolish) decision of deleting the ‘older versions’ of anaconda navigator. All my jupyter notebooks for a year worth of lab work ...
yarukorsin's user avatar
0 votes
0 answers
523 views

Python script over a file using AppleScript and Automator

I'm trying to run a python script over a file by right clicking it > Services > my service, without opening Terminal. This is my first attempt to do something like this and first time using ...
FerGil's user avatar
  • 1
1 vote
0 answers
58 views

Where application bundles get their environment variables from?

A user of my (Python based) app reports that they can't open it in regular way (via double clicking the icon in Finder) -- nothing just happens. When they run it from Terminal, they get an error (from ...
Aivar's user avatar
  • 193
0 votes
0 answers
329 views

localhost refused to connect after running Django server

I have looked at the questions similar to this and found none that matches. I was running PCcharm and Python and had to start the Django server. The first time I ran it worked fine but when I edited ...
xela56's user avatar
  • 1
1 vote
0 answers
292 views

How can I run JavaScript for Automation script from Python?

With the py-applescript package for Python, it is straightforward to run an AppleScript from Python without having to run a separate osascript subprocess: import applescript applescript.AppleScript('...
mhucka's user avatar
  • 1,167
2 votes
0 answers
119 views

What past battery usage data feeds the system preferences and activity monitor GUI?

I am currently using a Mac Book Pro running on Mac Big Sur version 11.1 I'm looking to access the data that feeds the system preferences and activity monitor displays of past energy usage. ...
zealous_nightingale's user avatar
0 votes
0 answers
158 views

Stopping a script pasted into and running through BTT (bettertouchtool)?

I have a python script that runs continously once turned on that I can turn on with a shortcut in BTT (bettertouchtool), but once it's on, I have no way to turn it off, it's pasted into the program, ...
Toddd's user avatar
  • 51
0 votes
1 answer
146 views

Hidden Python- and R-files: Safe to delete?

I am running macOS Catalina 10.15.7 on a 2020 MacBook Pro. I do a bit of programming in R and Python, and in my home directory I saw a bunch of hidden files: There are files related to ....
Tyler D's user avatar
  • 103
0 votes
0 answers
568 views

How to permanently skip a package dependency installation in Brew

How can I make Brew skip attempting to install Python@3.9 during brew upgrade? I have Python@3.8.7 already set globally. BACKGROUND: I'm running High Sierra 10.13.6, and at this time, Brew is ...
bento's user avatar
  • 101
1 vote
1 answer
289 views

GUI written in python (with PyQT/PySide2) does not launch

I just updated to Big Sur 11.2.1 and wanted to launch a python script that I wrote in a GUI with PySide2. When I launch the script, the terminals seems to be busy with the app: However nothing more ...
ecjb's user avatar
  • 484
0 votes
0 answers
80 views

Safari in Big Sur does not label active downloads with ".download"

I use a custom python script to actively organize my downloads. Since moving to Big Sur, it still works 100% of the time, but about 5-10% of the time on a big download I'll end up with multiple ...
Benjamin Schollnick's user avatar
0 votes
0 answers
125 views

MacVim's Python processes populate Activity Monitor and take 99% CPU

Every time I open up MacVim, a Python process starts up. After exiting the program, they remain running. Opening up MacVim a second time will produce another Python process. What do I do to stop this? ...
kanayt's user avatar
  • 331
1 vote
1 answer
267 views

Noob struggling to tell terminal to install scikit-image 0.16.2 for Pyxelate

I'm using macOS Catalina version 10.15.7 I think this should be a very easy install, but apparently not. At first, I spotted terminal told me I don't have Cython. Ok. I installed it, then it gave me a ...
曠佳信's user avatar
0 votes
0 answers
146 views

How to fix weird Python and urllib3 behavior with LMP USB-C gigabit ethernet adapter (connection aborted)?

I have this adapter for my Macbook Pro from 2019. I noticed something very strange that I'm debugging now since hours. I am using Ansible to create routes in Kubernetes and the following Ansible task ...
Tony Stark's user avatar
2 votes
1 answer
3k views

Python 3 Not Updating in Shell on Mac Mini M1

My Mac Mini M1 shipped with Python 3.8.5. I first installed Anaconda, then downloaded Python 3.9.1 (macOS 64-bit universal2 installer), installed that and ran Update Shell Profile.command. IDLE runs ...
fsa4's user avatar
  • 23
0 votes
2 answers
345 views

Is it safe to delete python and pip versions 2 and 3

Considering mac only requires version 2.7 of python, and any version of 3, is it safe to delete to delete pip2, pip3, and python3 completely from my mac when I have v3.9 and v2.7. I found them in this ...
mTvare's user avatar
  • 187
1 vote
2 answers
2k views

Upgrading Python 2.7 to 3.8 : Recommended?

I am running macOS Big Sur 11.1 on MacBook Air M1. It comes bundled with Python 3.9.1 for regular usage and running python command through terminal says that I have Python 2.7.16 for compatibility ...
asymptoticallyboundedgluon's user avatar
4 votes
1 answer
1k views

macOS 11 Pyenv Python 3.9.0 Install Error

I am trying to install python 3.9.0 on macOS 11.0.1. I have the latest version of brew and the latest pyenv. sids@Sids-MacBook-Pro ~ % pyenv install 3.9.0 python-build: use openssl@1.1 from homebrew ...
SidS's user avatar
  • 213
1 vote
1 answer
1k views

Creating an alias for Python in bash/zsh

I have often seen people recommending to setup an alias in one's .bash_profile or .zshrc along the lines of alias python='python3' This seems like a convenient idea, however, as far as I understand, ...
ersbygre1's user avatar
  • 132
1 vote
1 answer
126 views

PIP3 compile not working on Catalina

On my Mac (OSX 10.15.7) I try to install something using pip3: pip3 install ovirt-engine-sdk-python I get a GCC error: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -...
Krist van Besien's user avatar
-1 votes
1 answer
295 views

Could running Python and Matplotlib be keeping my computer from sleeping? How can I find out?

I have noticed that sometimes when I open my laptop the battery had dropped to 99% or even 97% after a day or so. I have it set up to sleep after being closed for 5 seconds, and I've verified that by ...
uhoh's user avatar
  • 1,420
14 votes
5 answers
41k views

Will macOS Big Sur remove the default Python installation for good?

I initially thought that this would happen with Catalina, but since it didn't happen a similar question is again relevant: My question is two fold: When I eventually update to macOS Big Sur, will the ...
ruohola's user avatar
  • 999
1 vote
3 answers
620 views

I'm saving debug logs for iTerm2 but why can't I find them?

I can't find the file /tmp/debuglog.txt anywhere using finder. locate debuglog.txt failed because there is no database, so I've built one using sudo launchctl load -w /System/Library/LaunchDaemons/com....
uhoh's user avatar
  • 1,420
0 votes
1 answer
4k views

How can I solve a mathplotlib error on BigSur?

My build and version of Big Sur is undetermined. I’m using homebrew which says submit a pull request rather tan ask them for support on prerelease macOS. I get this: > pip3 install matplotlib ...
Thomas's user avatar
  • 319
0 votes
0 answers
521 views

Issue with Python packages on BigSur beta but only from the shell

Since I am running the BigSur beta, I can't use Qt from python anymore; the viewer opens and closes instantly. I have this in the console: Sandbox: logd_helper(207) deny(1) file-read-data /Library/...
Thomas's user avatar
  • 319
0 votes
3 answers
2k views

Install python3 from Homebrew vs the installer from https://www.python.org/?

Is there any advantage of installing python 3 through homebrew vs through the installer from https://www.python.org/ or vice verse (except that the installer can give me the latest version)? I try ...
Qiulang 邱朗's user avatar
0 votes
1 answer
8k views

How to install Python 3.7 via homebrew on OS X

I need to rollback my homebrew-managed python 3.8 to 3.7. I have tried the approach from Homebrew: Rollback from Python 3.7 to Python 3.6.5.x? - Ask Different. So I unlinked 3.8, but my python.rb URL ...
halloleo's user avatar
  • 1,270
0 votes
2 answers
639 views

Python 3 'json' module is actually corrupted

I'm asking this question here and not on Stack Overflow because it appears to be MacOS specific. Many answers over there point to searching for a bad "json.py" module however we can see from ...
Charney Kaye's user avatar
1 vote
2 answers
374 views

cron queueing bash and python scripts

I'm currently looking to understand and get comfortable with crontab queues on my macbook pro. I recently solved an issue where my simple bash script would not execute. It turns out I had to move my ...
Francisco Avalos Jr.'s user avatar
1 vote
1 answer
684 views

What does "link: false" mean in my Brewfile?

My Brewfile created with brew bundle dump contains one line with link: false: ... brew "git" brew "python@3.8", link: false brew "glib" ... I don't see any kind of --...
Not22's user avatar
  • 183
1 vote
1 answer
3k views

How to install Anaconda python for multiple or all users?

How to install https://www.anaconda.com/products/individual not just for Administrator? I was trying to install it from GUI but installation for all users was disabled:
slava's user avatar
  • 257
0 votes
0 answers
252 views

Cannot find my Miniconda Python installation after switching from bash to zsh

Recently after upgrading to Catalina, the terminal changed from bash to zsh, and I lost my Python installation. My Python was installed with Miniconda, but now I can't find it anymore, I can only see ...
LWZ's user avatar
  • 306
2 votes
2 answers
973 views

Why does my zsh program run fine in terminal, but not as an automator app? [duplicate]

I got a mac last week and am trying to learn the basics by coding a few projects I came up with. I've been creating a few apps I can place on the dock that automate simple functions that I use often. ...
Alfie Stoppani's user avatar

1 2
3
4 5
12