Questions tagged [python]

Python is a programming language that is included in the standard macOS installation. If you have any programming questions about Python, ask them on Stack Overflow.

Filter by
Sorted by
Tagged with
0
votes
1answer
14 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
23 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
67 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
43 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
0answers
20 views

Can't do pipenv install --python3.9 on VS, shows exceptions

I'm a python beginner. I'm using Visual Studio and used to be able to do pipenv install --python3.9 in the terminal, but now after I've done a lot of installation and stuff (by following different ...
0
votes
2answers
123 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
21 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
645 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
46 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, ...
0
votes
1answer
27 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 -...
0
votes
0answers
137 views

I am using OpenCv on Big Sur and I am unable to get the pop ups which show us the image

import cv2 import numpy as np def tell(x): pass cv2.namedWindow('rackBarsWindow') cv2.createTrackbar('B','rackBarsWindow',0,255,tell) while (1): img=cv2.imread('logo.png') img=cv2.resize(img,(512,512))...
-1
votes
1answer
44 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 ...
1
vote
4answers
10k 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 ...
1
vote
1answer
55 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....
0
votes
1answer
2k 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 ...
0
votes
0answers
342 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/...
0
votes
1answer
50 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 ...
0
votes
1answer
103 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 ...
0
votes
2answers
48 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 ...
1
vote
2answers
40 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 ...
0
votes
0answers
21 views

Similar video finder app/script/solution

I have a videos folder, which has a bunch of duplicates. Problem is your average duplicate file detector apps can't detect these, because the videos are not 100% identical (the videos will have 20 min ...
1
vote
1answer
53 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 --...
0
votes
1answer
141 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:
0
votes
0answers
93 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 ...
1
vote
2answers
127 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. ...
3
votes
2answers
77 views

Why is pip3 referencing Python 2 instead of 3?

When I try to install Python pacakges using pip3 on macOS (Catalina) it searches Python 2 instead: vger:~(61)+>- sudo -H pip3 install xattr DEPRECATION: Python 2.7 reached the end of its life on ...
0
votes
1answer
35 views

LaunchAgents runs Python script in version 2

Maybe someone can explain this. I'm having LaunchAgents run a Python script on startup. The relevant part of the plist looks like: <key>ProgramArguments</key> <array> <string&...
1
vote
3answers
6k views

How to install python3.7 on a mac (mojave using homebrew

I am running MacOS Mojave (10.14.6) and want to install python 3.7. Currently I have python 3.6 installed: $ python -V Python 3.6.9 There seems to be python 3.7 available: $ brew search python ==> ...
0
votes
1answer
38 views

Why does Python keep popping up and occupying my CPU?

I occasionally get Python popping up and occupies all my CPU I have no clue why this is happening, because I almost never run Python on my laptop. Here is an update on December 9, 2020 I think the ...
0
votes
0answers
34 views

Pyglet not working on MacBook

I have installed Pyglet on my mac for python 3.8 but it isn't working . By that I mean when I type pyglet.font.add_file('DIN Next W01 Light.ttf') to add that font into my file it shows an error No ...
2
votes
2answers
262 views

What causes excessive CPU use by taskgated, notifyd, and launchd processes?

I've looked around a lot to try to find the answer to this but have thus far been unsuccessful. I am programming in Python, and I have code that takes a long time to run (hours to months depending on ...
1
vote
1answer
29 views

which certificate/identifiers/profilers should be used for python script to be distributed as a pyinstaller build/bundle outside the app store?

My program works as follows In a while loop, it checks for the active window change - AppKit library used from AppKit import NSWorkspace active_window = (NSWorkspace.sharedWorkspace()....
0
votes
1answer
79 views

Python launcher Icon every time a script runs

I've had a MacBook given to me from work for over a year now and recently I got a new mac and every time I launch a python script the python launcher icon appears in the mac dock. However, in the old ...
-1
votes
2answers
49 views

Updating python on macOS

Its usually not recommended to update a system package (such as python) on macOS. However, I have been asked to upgrade to test something. So now the question is - how hard it is to update python on (...
0
votes
0answers
6 views

Unexpected behavior with php in Catalina + Apache2 — classic “phpinfo.php” script produces a “Save” dialogue box, but no error msgs

I am using the default installations of Apache2 and php7 that came with Catalina on a Mac AIR. I am trying to run the classic phpinfo.php script: <?php phpinfo.php ?> My https.conf file ...
0
votes
0answers
11 views

why python 2.7 doesnt pick pyqt4 installed using homebrew

I needed to fix the application before I migrate it to pyqt5, so I installed pyqt4 using brew: brew install cartr/qt4/pyqt now when I tried launching pyqt4 app I still get this error: Traceback (most ...
2
votes
2answers
982 views

How to code-sign my python script / package packaged for mac using pyinstaller without using xcode?

I have written a python script and bundled it using the PyInstaller. The executable file inside the dist folder works fine on my Mac. But not on someone else's Mac even if they've set "App Store ...
0
votes
0answers
14 views

How to make script run on system start/user login via terminal [duplicate]

I have Mac OS PC, let's name it PC1, and I have Linux PC (PC2), on Mac os PC I have python script(reverse shell), I need to make it run on system start or user login(no matter) threw terminal, I have ...
0
votes
0answers
13 views

Command + W has stopped working for python app

I'm working on a matplotlib Python application to draw graphs (MacOS Catalina 10.15.5). I was able to close the window using Command + W but recently that doesn't seem to work. The shortcut works with ...
1
vote
0answers
60 views

Failed to import cxutils module into Python

I had been using Crossover for a while on High Sierra (10.13.6) without any problem but recently, I needed it again and tried to install it again but encountered a very annoying error. Looked for a ...
0
votes
0answers
29 views

Failing to connect Python to MySQL — no luck with brew install mysql-connector-c

I think I must have made some mess with brew install/uninstall of MySQL, but I don't know how to get out of this state: I'm trying to run MySQL stuff on Python 3.7 (High Sierra 10.13). However: ...
2
votes
1answer
192 views

Python with Catalina : No module named 'OpenGL'

I am running the examples provided by the PyQtGraph python graphic module, on a MacOS Catalina. They all work fine for me, except those in 3D. I have a message : Traceback (most recent call last): ...
0
votes
1answer
53 views

My Mac Book Pro switch between charge and not charge when running a long program

When I am running a very long program (e.g. A long python script) and when I plug in the charger, my laptop will switch between charging and not charging very frequently. However, if I stop that ...
0
votes
0answers
54 views

Python3 script runs fine in Terminal but not as a crontab job

Using an iMac, Catalina. Recently changed ISP and need to know when feed was swapped over. New to Python scripting. I managed to get this running in Terminal, But not crontab. Crontab reads:- @reboot ...
1
vote
0answers
767 views

How to Install NLTK for Python3 on Mac [duplicate]

I am trying to use NLTK and am able to do so using python2.7, but I am unable to use it with python3 (i.e. when I type import nltk, I get the following error message: ModuleNotFoundError: No module ...
0
votes
1answer
49 views

What's the `darwin` in Mac?

In my Mac I execute the code: import sys print(sys.platform) then get darwin, why it is not OSX. I don't know where to look for documentation on python sys module. What's the darwin ?
0
votes
1answer
57 views

Facing problem to test Energy Consumption by a factorial function with Python module “pyRAPL”

I would like to calculate energy consumption. That's why I have used the following program, unfortunately it gave errors. MWE: #need python3.7 to run this from math import * import time # time ...
0
votes
1answer
56 views

How do I get Apache to use the default pyenv Python version instead of the system one?

I am using plain Apache 2.4 on Mac OS Catalina. I installed pyenv to manage python versions. The default Python is 3.8.0 Now I try to have Python scripts running in Apache. I created a subdomain ...
1
vote
1answer
60 views

How do I install python pyRAPL module on MacOS?

How do I install python pyRAPL module on MacOS high sierra 10.13.6? The following errors are coming up whenever I try to install. How do I solve it?
1
vote
1answer
330 views

How to view real time dynamically updated information on thermals and fan speed through the terminal?

Is there any way to view real time fan speed and thermal information (CPU, GPU) through the terminal, such as by installing an application with homebrew (i.e. $ brew install ...) or python (i.e. $ pip ...

1
2 3 4 5
10