Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve ImportError: dlopen(): Symbol not found:.... Expected in: flat namespace

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

like image 688
Oliver Robie Avatar asked Mar 19 '20 16:03

Oliver Robie


2 Answers

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

like image 161
Oliver Robie Avatar answered Sep 28 '22 12:09

Oliver Robie


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)

like image 25
Stroboscopio Avatar answered Sep 28 '22 10:09

Stroboscopio