apple-m1

Numpy fails in Pycharm but runs on VSCode/terminal M1 Mac

Numpy fails in Pycharm but runs on VSCode/terminal M1 Mac Question: My code uses matplotlib which requires numpy. I’m using pipenv as my environment. When I run the code through my terminal and pipenv shell, it executes without a problem. I’ve just installed Pycharm for Apple silicon (I have an M1) and set up my …

Total answers: 3

How to solve "NameError: name 'basestring' is not defined" when importing psycopg2?

How to solve "NameError: name 'basestring' is not defined" when importing psycopg2? Question: I am trying to import the psycopg2 package on python 3.7.13 but I get the following error: python -c "import psycopg2" % 11:22:56 Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/mm/.pyenv/versions/3.7.13/lib/python3.7/site-packages/psycopg2/__init__.py", line 68, in <module> from psycopg2 …

Total answers: 1

Apple M1 – Symbol not found: _CFRelease while running Python app

Apple M1 – Symbol not found: _CFRelease while running Python app Question: I am hoping to run my app without any problem, but I got this attached error. Could someone help or point me into the right direction as to why this is happening? Traceback (most recent call last): File "/Users/andre.sitorus/Documents/GitHub/nexus/automation-api/app/main.py", line 4, in <module> …

Total answers: 2

Unable to import psutil on M1 mac with miniforge: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Unable to import psutil on M1 mac with miniforge: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) Question: I’m using a miniforge environment on an M1 mac, and unable to import psutil: ImportError: dlopen(/Users/caspsea/miniforge3/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so, 0x0002): tried: ‘/Users/caspsea/miniforge3/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64e’)), ‘/usr/local/lib/_psutil_osx.cpython-39-darwin.so’ (no such file), …

Total answers: 2

Install Anaconda Navigator with Miniforge (Mac with M1 chip)

Install Anaconda Navigator with Miniforge (Mac with M1 chip) Question: I have a MacBook with an M1 chip and have installed miniforge since this will run natively on the M1 chip. Question: How do I install Anaconda Navigator so that it uses the miniforge environment when I use it to launch Spyder and Jupyterlab? Or …

Total answers: 2

Error installing python 3.7.6 using pyenv on new macbook pro M1 in OS 12.3+

Error installing python 3.7.6 using pyenv on new macbook pro M1 in OS 12.3+ Question: I am struggling to install python version 3.7.6 using pyenv on my new macbook pro M1 running on mac os 12.3.1. My configuration $ clang -v Apple clang version 13.1.6 (clang-1316.0.21.2) Target: arm64-apple-darwin21.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin $ pyenv …

Total answers: 2

Problems installing lxml on M1 mac

Problems installing lxml on M1 mac Question: So, I’m having the classic trouble install lxml. Initially I was just pip installing, but when I tried to free up memory using Element.clear() I was getting the following error: Python(58695,0x1001b4580) malloc: *** error for object 0x600000bc3f60: pointer being freed was not allocated I thought this must be …

Total answers: 6

Gevent cant be installed on M1 mac using poetry

Gevent cant be installed on M1 mac using poetry Question: I tried to install many dependencies for a virtual environment using poetry. When it gets to gevent (20.9.0) it gets the following import error: ImportError: dlopen(/private/var/folders/21/wxg5bdsj1w3f3j_9sl_pktbw0000gn/T/pip-build-env-50mwte36/overlay/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so, 0x0002): tried: ‘/private/var/folders/21/wxg5bdsj1w3f3j_9sl_pktbw0000gn/T/pip-build-env-50mwte36/overlay/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64e’)), ‘/usr/local/lib/_cffi_backend.cpython-38-darwin.so’ (no such file), ‘/usr/lib/_cffi_backend.cpython-38-darwin.so’ …

Total answers: 4