11

Can anyone help me solve this issue?

ImportError: dlopen(/Users/......./venv/lib/python3.6/site-packages/recordclass/mutabletuple.cpython-36m-darwin.so, 2): Symbol not found: __PyEval_GetBuiltinId
  Referenced from: /Users/......./venv/lib/python3.6/site-packages/recordclass/mutabletuple.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/......../venv/lib/python3.6/site-packages/recordclass/mutabletuple.cpython-36m-darwin.so

I'm using a Mac if that's of any relevance

Oliver Robie
  • 818
  • 2
  • 11
  • 30

5 Answers5

10

I couldn't quite figure out what the issue was but I'm assuming __PyEval_GetBuiltinId was broken/uninstalled.
So all I did to fix this was pip uninstall recordclass and then pip install --no-cache-dir recordclass and it seemed to have worked

Oliver Robie
  • 818
  • 2
  • 11
  • 30
4

I encountered the same problem and found your question. I have an M1 MacBook, but I think we're encountering 2 problems. At first, I had a similar error to yours:

ImportError> dlopen(): Library not found

What I did to fix this error was 'brew install ___' the library that was missing, in my case it was tesseract. After I brew installed it again I ran my script and got a new error. This time I had a

no suitable image found: imageXXX found but wrong architecture

So what I think may be happening is there is an underlying error with the compatibility between our M1 chips and the brew install-ed formulaes. I'm currently trying to find a solution. The first I'm going to try is resetting my installation from scratch and, if that doesn't work, look at alternatives. Ultimately I think what will solve the problem is installing from source like is described on the OpenCV website: https://docs.opencv.org/master/d0/db2/tutorial_macos_install.html.

Hope this helped!

EDIT I just finished uninstalling Homebrew completely and the reinstalling it from scratch, both casks, formulae, EVERYTHING! And it seems to work. I got both Tensorflow and OpenCV to work (they both printed their versions and I ran a simple camera test on OpenCV)

Stroboscopio
  • 150
  • 3
  • 11
1

This issue is well described here. I had the same issue with the NetCDF4 library in the macOS M1 chip. In my case (NetCDF4@1.5.8) installing the library using brew and pip didn't solve the problem as the provided package wasn't compatible with the M1 chip. The issue will solve as mentioned in their Github in NetCDF@1.6.0.

In such cases, I recommend:

First make sure that you install dependencies of the library (in this case recordclass) that you are using in your system in case you are using a virtual environment, not just in the environment.

Second check if the wheel of the library meets your machine requirements.

Sina
  • 11
  • 1
0

In my case, this happened on an M2 Mac Mini and on mysqlclient package. After going through various suggestions from here on SO, the one that worked for me was the following steps:

Check which version was used by the python of the system host:

% python3 --version
Python 3.11.1

Check version used by virtualenv: (venv) % python3 --version Python 3.9.13

So the virtualenv was using a different python version. I removed the virtualenv and installed a new virtualenv with the same version as host system:

python3.11 -m venv venv

After that, on reinstalling the packages which causes problems, it worked.

Joel G Mathew
  • 7,561
  • 15
  • 54
  • 86
0

Same here, I just downgrade to python 3.8.16

ChaosPredictor
  • 3,777
  • 1
  • 36
  • 46