macos

Unable to run python files in terminal on Mac

Unable to run python files in terminal on Mac Question: I create a file and try run it in my terminal and get this error "/Library/Developer/CommandLineTools/usr/bin/python3: can’t open file ‘/Users/dcg/pb’: [Errno 2] No such file or directory" I’m not sure why, as when I Cd and I’m in the correct directory. This is a my …

Total answers: 1

Cannot import mediapipe – "ModuleNotFoundError: No module named 'mediapipe'"

Cannot import mediapipe – "ModuleNotFoundError: No module named 'mediapipe'" Question: I have installed mediapipe , but I can’t import it. pip3 install mediapipe==0.8.4.0 pip3 list mediapipe == 0.8.4 numpy == 1.23.3 opencv-contrib-python == 4.6.0.66 tensorflow == 2.10.0 python –version Python 3.9.6 I try to runn this in the VS Code editor on Mac(Intel) import cv2 …

Total answers: 1

Cannot install ansible-pylibssh on macOS

Cannot install ansible-pylibssh on macOS Question: I’m trying to install ansible-pylibssh on an Apple Silicon based Mac. ansible is already installed. When running pip3 install ansible-pylibssh I get the following error: pip3 install –user ansible-pylibssh  1 ✘  took 3s   at 00:36:15  Collecting ansible-pylibssh Using cached ansible-pylibssh-1.0.0.tar.gz (97 kB) Installing build …

Total answers: 3

Communicating with root child process launched with osascript "with administrator privileges"

Communicating with root child process launched with osascript "with administrator privileges" Question: How can I pass messages between a parent process that launches a child process as root using Apple Script and stdin/stdout? I’m writing an anti-forensics GUI application that needs to be able to do things that require root permissions on MacOS. For example, …

Total answers: 1

Postgres suddenly raise error '/usr/lib/libpq.5.dylib' (no such file)

Postgres suddenly raise error '/usr/lib/libpq.5.dylib' (no such file) Question: when I run Django project or any code related to Postgres : Referenced from: ‘/Users/mahmoudnasser/.local/share/virtualenvs/wyspp_backend-PwdII1PB/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so’ Reason: tried: ‘/opt/homebrew/opt/postgresql/lib/libpq.5.dylib’ (no such file), ‘/usr/local/lib/libpq.5.dylib’ (no such file), ‘/usr/lib/libpq.5.dylib’ (no such file) I tried many solutions online but none of them worked. Note: I use MacOS Asked By: Mahmoud …

Total answers: 4

poetry installation failing on Mac OS, says "should_use_symlinks"

poetry installation failing on Mac OS, says "should_use_symlinks" Question: I am trying to install poetry using the following command curl -sSL https://install.python-poetry.org | python3 – but it is failing with the following exception: Exception: This build of python cannot create venvs without using symlinks Below is the text detailing the error Retrieving Poetry metadata # …

Total answers: 4

Errno 13 Permission denied error when trying to load Huggingface dataset

Errno 13 Permission denied error when trying to load Huggingface dataset Question: I’m trying to do a very simple thing: to load a dataset from the Huggingface library (see example code here) on my Mac: from datasets import load_dataset raw_datasets = load_dataset("glue", "mrpc") I’m getting the following error: PermissionError: [Errno 13] Permission denied: ‘/Users/username/.cache/huggingface/datasets/downloads/6d9bc094a0588d875caee4e51df39ab5d6b6316bf60695294827b02601d421a5.759f3e257a3fad0984d9f8ba9a26479d341795eb50fa64e4c1de40f1fc421313.py.lock’ I’ve …

Total answers: 2

leaving Anaconda environment in Terminal (Mac)

leaving Anaconda environment in Terminal (Mac) Question: I recently installed Anaconda on my Mac for starting to code with Python using Spyder, but decided to switch to VSCode (without starting Anaconda) which I find less confusing (I’m a casual coder). However, every time I open Terminal now on my Mac, the prompt starts with "(base)" …

Total answers: 1

Python MacOS Loop Files Get File Info

Python MacOS Loop Files Get File Info Question: I am trying to loop through all mp3 files in my directory in MacOS Monterrey and for every iteration get the file’s more info attributes, like Title, Duration, Authors etc. I found a post saying use xattr, but when i create a variable with xattr it doesn’t …

Total answers: 1