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
-1
votes
1answer
36 views

What is the current correct way to install pip on macOS? [closed]

I'm seeing a fair amount of conflicting information on Reddit and Stack Overflow on this topic. I'm a long-time Linux user, just bought my first macOS computer. For python development, I'm seeing that ...
1
vote
0answers
44 views

Correct packages installation without using Homebrew

I was reading this old post because I want to download a homebrew package without using brew : How to download a binary from brew without installing brew? but I'm stuck so I try to ask too. I'm on ...
1
vote
1answer
43 views

ZSH conflict with Python setuptools extras and pip?

I have installed python 3.9.7 using pyenv. I then installed a package webchanges which has optional dependencies to be installed using setuptools extras and pip format: pip install --upgrade ...
0
votes
1answer
37 views

Permissions on `brew` and `pip3`

Somehow permissions have been altered on brew and/or pip3 and both are getting errors. brew has a lock file but when I remove it with sudo, brew commands say it iw still there. pip3 worked to install ...
1
vote
1answer
68 views

How to install Anaconda on External Hard drive?

I have the Apple Silicon Macbook Air with 256 GB, and am interested in installing Anaconda mainly Jupyter notebook in my Mac. When I tried installing it on my external Hard drive, which is a 1TB SSD, ...
0
votes
1answer
45 views

How do I prevent zsh from suspending python script

Someone once told me that zsh is just a different version of bash because of some copyright thing, so I guess I ask this question here. I have a python script that's running in a terminal and for no ...
2
votes
2answers
471 views

How to delete a system file as an admin

I am an "admin" user on a Mac running Big Sur. I am trying to remove a symlink: $ ls -al /usr/bin/python lrwxr-xr-x 1 root wheel 75 Jan 1 2020 /usr/bin/python -> ../../System/Library/...
0
votes
0answers
59 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!
0
votes
0answers
25 views

How can I get screen grab pixel data from a different 'desktop space' than the one I am currently viewing?

I'm wanting to find some way of using Python to get colours of pixels to notify me when a change happens on a game. The point is, I don't want to have to keep the game on the front of the desktop and ...
0
votes
2answers
451 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/....
1
vote
1answer
58 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 ...
0
votes
0answers
37 views

How to execute bash/python scripts as soon as device goes to sleep?

I was hoping to write a script that would execute a few commands as soon as I close the lid of my laptop and run them again when I open my laptop. I know I can get the system details with pmset -g, ...
0
votes
1answer
60 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" ...
0
votes
2answers
69 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 ...
0
votes
0answers
450 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): ...
1
vote
0answers
48 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 ...
3
votes
4answers
3k 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 <...
0
votes
0answers
43 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 ...
1
vote
1answer
54 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'] ...
0
votes
1answer
423 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. ...
1
vote
0answers
86 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 ...
0
votes
1answer
27 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://...
1
vote
0answers
32 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 ...
2
votes
1answer
661 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....
0
votes
0answers
133 views

Process throttled after exceeding limit of 150 wakeups per second

I have a process that crunches through some data, running more than 12h. Often it completes without issues but sometimes it slows to a crawl as if it is being throttled. The CPU is close to idle after ...
0
votes
0answers
218 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, ...
0
votes
0answers
88 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 ...
0
votes
0answers
27 views

Unable to launch Firefox using Selenium

I installed Python 3.8 on MacOS Mojave (10.14.6) using pyenv. I then installed selenium. There was an issue missing the geckodriver. I then installed the geckodriver. After that I ran the program. ...
0
votes
1answer
29 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 ...
0
votes
0answers
92 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 ...
0
votes
0answers
18 views

For some reason when i do anything python3 related on my terminal it comes up with the error "Illegal Instruction". Why is this happening? [duplicate]

When I try to run for example a simple print("Hello World") My terminal comes up with the error Illegal Instruction And it's causing issues.
1
vote
0answers
25 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 ...
0
votes
0answers
54 views

Issue PYSNMP: [Errno 8] nodename nor servname provided, or not known

Cannot ping my local machine I have this same issue with the following code: from pysnmp.hlapi.asyncore import * # Import the IPadresses ip_add_file = open('ip.txt', 'r') ip = ip_add_file print("...
0
votes
0answers
152 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 ...
1
vote
0answers
129 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('...
2
votes
0answers
47 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. ...
0
votes
0answers
31 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, ...
0
votes
1answer
31 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 ....
0
votes
0answers
55 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 ...
1
vote
1answer
56 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 ...
0
votes
0answers
36 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 ...
0
votes
0answers
74 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? ...
1
vote
1answer
88 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 ...
0
votes
0answers
61 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 ...
1
vote
1answer
2k 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 ...
0
votes
2answers
116 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 ...
0
votes
2answers
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 ...
0
votes
0answers
64 views

Script to download photos from shared iCloud link

I have a list of the iCloud links which are shared. I can click on the link and download it one by one. However, is there any way I can run the script and download all the images from a shared link? I ...
3
votes
1answer
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 ...
1
vote
1answer
232 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, ...

1
2 3 4 5
11