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
1 answer
89 views

Get attachments from .eml files that are not in ~/Library/Mail

I copied a large number of .eml files from Mail.app to a separate folder. Each message has two attachments: a .kmz in base64 and a .gpx in plain text. I want to get these attachments from the .eml ...
0 votes
1 answer
56 views

help with sh files on mac

so i am analyzing a data set and preparing it for preprocessing and I am back into computer science aftersome time so bear with me ( I am a mac user) i am trying to run this sh file that will not run ...
0 votes
1 answer
47 views

Regarding installation of command line develeoper tools for python3

I am using MacBook Air M1 macOS Ventura 13.4 (recently software updated) . I installed python for Mac and also VS code along with python extensions in VS code. After writing a code and on pressing ...
5 votes
1 answer
813 views

Catalina and pyenv install python versions fine, but anything needing ssl fails

I seek to use pyenv instead of manually installing an official python release. My goal is to run the included script titled “Install Certificates.command”. My assessment of the situation is pyenv is ...
3 votes
1 answer
463 views

How can I fix things when LaTex issues a package minted error for "Pygments" or pigmentize?

I am trying to install the "Pygments" package to Python via terminal on my Mac so that I can utilize the "minted" package in Latex. I have downloaded the package via the terminal by using the ...
6 votes
2 answers
10k views

Create Automator Service With a Python Script?

I'm trying to create an Automator Service that will act on selected text, converting dashes to spaces, and also making word caps for all the text. A friend gave me this python script (I know nothing ...
1 vote
1 answer
193 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
0 answers
48 views

Upgrade Python - Why is there no official guide for this?

I currently have Python 3.9 installed on my Mac. However, I wanted to upgrade to version 3.11. Especially since the old versions will eventually no longer be supported with updates for security. Now I ...
1 vote
1 answer
2k views

How would I export data from Python to spreadsheet (Apple Numbers Format)?

I'm currently trying to automate the export of data from a Python script to Apple's .numbers spreadsheet. Currently, I export from Pandas using .csv. My specific use-case is to update an existing ...
93 votes
5 answers
229k views

How to install specific version of python on OS X

I need to install python3.4 on my OS X. Tried to do it with brew install python3 and now I have python 3.5.1. But I need py3.4. How can I install python3.4 on my Mac?
0 votes
1 answer
104 views

My Mac doesn't allow installation of any software

Every time I try to install any software on my Mac, it comes up with an error. I have scoured the net and have followed advice which includes checking if there's enough space (which I have), checking ...
0 votes
0 answers
6 views

AWS data set naming [migrated]

I am trying to pre process data and since i am inexperienced i am hitting dead ends I have a bucket named, region figured out, but now it is giving me the error: enter codcovid-19-testing-data-master %...
3 votes
1 answer
1k views

Can I run python code on an iPad?

I usually use an iPad to answer questions or program. Before answering, I wish to test to ensure they function well. At this situation, I find it sometimes inconvenient to get to a computer. How can I ...
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 ...
0 votes
1 answer
66 views

Getting a "command not found: conda" message whenever I open terminal

I am running OS Ventura 13 on a Mac with an M1 chip. I've been trying (partially successfully??) to configure a python-based code repository on my computer but as I've been trying to download the ...
2 votes
2 answers
2k 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
1 answer
60 views

Can't create the ".ideavimrc"-file which i need for using vim with pycharm

So i wanted to start using vim in PyCharm and use a custom set of keybinds for that. I installed the ideavim plugin inside PyCharm. https://www.jetbrains.com/help/pycharm/using-product-as-the-vim-...
0 votes
1 answer
112 views

(Monterey) Could System Integrity Protection be keeping Python3's "MySQL" library from loading?

The "MySQL" client interface library will not load on MacOS Monterey. The relevant traceback lines are as follows: (System is Django, latest versions of everything.) ImportError: dlopen(/...
27 votes
7 answers
98k views

M1 mac: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e') - python

When I try to run "scrapy startproject" in vscode, below error comes up. Traceback (most recent call last): File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/bin/...
0 votes
1 answer
144 views

iTerm2 Python scripting on M1/M2 (Apple Sillicon) [duplicate]

iTerm2 can be scripted with Python When I run Python REPL or Python script through iTerm2 Scripting menu on Apple Sillicon architecture (M2 in my case) it terminates with following error: Bad CPU type ...
0 votes
3 answers
5k views

Cannot uninstall Python from homebrew

which -a python3 /opt/homebrew/bin/python3 /opt/homebrew/bin/python3 /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 /usr/local/bin/python3 /usr/bin/python3 I want to uninstall ...
1 vote
0 answers
26 views

Is there a simple way to start a bash script at login or startup WITHOUT revealing the terminal? [duplicate]

I know similar questions have been asked on forums, but due to the constraints of my script, the other solutions are either too complicated or do not work. Please forgive my lack of knowledge in the ...
1 vote
1 answer
20 views

Why isn't my Platypus-built app accepting dropped folders?

I have a little Python 2.7 script I turned into an app using Platypus a number of years ago. After updating Platypus to the latest version (5.4.1) I just wanted to rebuild the app so it would start ...
0 votes
3 answers
1k views

Why are there two apps called “python” and "python launcher" seperately?

Why are there ‘Python’ and 'Python launcher’? What’s the difference? "Python launcher" is in Applications/python 3.10/python launcher “python” is in the MacintoshHD/library/frameworks/python....
1 vote
1 answer
120 views

Reading a text file located in iCloud Shortcuts folder using a Python script on Mac

I am appending text to a file located in Shortcuts folder using a shortcut on iPhone. I want to access the contents of this file from a Python script on Mac like any other text file. I am unable to ...
2 votes
1 answer
790 views

Why does Python's readline.read_history_file not work from a script, but work interactively?

I asked over on Stack Overflow, but this seems a problem specific to Mac OS X as the error does not happen on other OS (ubuntu for example). https://stackoverflow.com/q/42637680/447830 repeated ...
21 votes
2 answers
18k views

How to make python 3.11 my default python3 with brew

I like new software and I noticed that 3.11 is available in brew, so I have installed it: brew install python@3.11 I can get a repl by running python3.11, but if I run python3 I still get python 3.10 ...
0 votes
0 answers
40 views

Is there a way to trace syscalls without disabling SIP?

I'm trying to optimize a local Python script and I'd like to see syscalls etc. dtruss seems like a great tool for that, but I get a series of errors when I run it that I think are related to SIP being ...
1 vote
3 answers
629 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
1 answer
448 views

Set Mac to wake and run scripts while in sleep mode

I'm a Python developer and I would like the Mac to awaken from sleep when I configure it to do so and run some scripts or certain programs during the day. On Windows there's "Task Scheduler" ...
0 votes
0 answers
14 views

VS code using older file versions - required to run setup.py to run changes

I'm using vs code working with my repository. Every time, I save one of the files, the updates seemingly aren't going through, as when I run a file that imports one of these changed saved files, vs ...
2 votes
3 answers
2k views

Automator action to run python script on series of files fails in Catalina

Major edit I've just discovered that the Automator workflow I'm having problems with works perfectly if I run it by pressing 'play' in the Automator window, and it seemingly only fails when I save it ...
0 votes
0 answers
50 views

Old iPads and data pull automation

I have 20 old iPads (mini 5th gen, software version 12.2) that are used for note taking daily. The application, Tap Forms HD has a export folder that holds a .csv file. The .csv file is still stored ...
14 votes
4 answers
11k views

Why is 'xattr' not working?

When I attempt to execute xattr in Terminal, I get Traceback (most recent call last): File "/usr/bin/xattr-2.7", line 33, in <module> import xattr ImportError: No module named xattr What'...
1 vote
1 answer
665 views

not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)

I'm trying to run a 3rd party application through the Spyder Python IDE. I'm able to import the code and it runs through the command line using the Terminal application but Spyder appears to be more ...
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....
0 votes
0 answers
17 views

A script that opens .py types in values required

First a bit of backstory, when I do python assignments I had to manually add inventory items again and again which was painful so I wrote a shell script which would start my python program and enter ...
1 vote
1 answer
1k views

How can I set Python symlink in MacOS Ventura?

I am trying to set a symlink so that I can point the python command in Terminal to a new install of python3. I last did this in Mojave, where one could disable csrutil and then run the following ...
0 votes
0 answers
99 views

Problem with VSCode and Python on a Mac

I am trying to use VS Code to program in Python on my Mac. I keep getting the following error when I run my program in VS Code: python -u "/Users/davidcfeola/Desktop/Python/Segmented Turning Data....
17 votes
3 answers
224k views

Where is my .bash_profile located? (Mac OS 10.10.5)

Disclamer: I am a newbie to UNIX programming. I downloaded Anaconda but then realized that I did not need it. I deleted and uninstalled it as fully as I could find out how. It seems that everything ...
0 votes
0 answers
92 views

Python script hangs on importing rasterio

I'm a recent migrant from Linux to OSX, and the transition so far has been quite smooth, until this particular issue. On a MacBook Pro with the M1 chip, running Ventura 13.1, and with both Python 3.9 ...
0 votes
0 answers
32 views

Automator remove all but the first page of a pdf in Monterey

Under Monterey, Is there an easy way to have automator delete all but the 1st page of a pdf file. Or extract the 1st page? My end goal is to create a thumbnail image from the 1st page, but the ...
1 vote
0 answers
38 views

Using NVidia‘s CUDA and corresponding Python libraries on macOS Monterey

I occasionally need to work on scientific software that uses CUDA and is written in Python. If possible, I would like to do that on an iMac 2019 (Intel, with a Radeon Pro 580X, running macOS Monterey ...
1 vote
0 answers
326 views

MacOS can't display an open3d window from remote server,GLX_ARB_create_context_profile is unavailable

Problem Device and OS version: MacBook Pro 2021 Apple Silicon 13.0.1 (22A400) The remote server can't forward open3d window to my Mac the codes are as follows: import copy import numpy as np import ...
1 vote
0 answers
36 views

How to automatically set Terminal profile for different conda environment

I often use different conda environments. For convienience, I like setting different Terminal profiles (colors specifically) for each environment for ease of use. This is currently done manually after ...
1 vote
0 answers
90 views

pip ALWAYS installs to /usr/local/lib/python2.7

I cannot find a way to get a functioning pip3 on macos Big Sur. I have tried standard python, HomeBrew python, and also pyenv/venv, following the directions and searching for issues in each case. In ...
1 vote
1 answer
129 views

Python script does not run in Downloads folder

I am puzzled. My Python script has two parts. It's very simple. Part-1: Makes a new folder based on date and time. Then moves all the files into that folder. This happens once a day controlled by ...
2 votes
1 answer
757 views

Apps broken after Monterey 12.3 update

After having updated macOS to Monterey 12.3 a number of programs or apps are failing to work. For example, when trying to run perl I obtain -bash: /usr/local/bin/perl: Bad CPU type in executable Same ...
0 votes
1 answer
373 views

How to install Pygmentize on MacOS?

I'm trying this to install pygmentize on GitHub Actions macos-12 OS: $ pip3 install pygments $ pygmentize -V However, the first command does install pygments Python package, but doesn't install ...
0 votes
1 answer
2k views

How to create a link to python3 on MacOS?

Running MacOS 13.1 (Ventura) I see that python3 is installed in /usr/bin, which I can call by running python3. However, I also want to run python3 by just calling python, so I changed to the folder /...

1
2 3 4 5
12