Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facing Import Error while running the imported packages in jupyter notebook of VS code

Error: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_xcb_connect'

Below is the piece of code I'm trying execute

Declarations and imports

import warnings warnings.filterwarnings('ignore') import pandas as pd import numpy as np

from matplotlib import pyplot as plt

The complete Screenshot enter image description here

Thanks in advance for helping out

like image 296
Pavan Desai Avatar asked Feb 01 '26 02:02

Pavan Desai


2 Answers

I faced the same issue on Mac M1 chip with pyodbc library, I resolved this and it worked for me, hope it will helps you as well.

I managed to fix it with a --no-binary option which forces pip to compile the module from source instead of installing from precompiled wheel.

pip uninstall pyodbc 
pip install --no-binary :all: pyodbc
like image 134
Mahesh Avatar answered Feb 03 '26 05:02

Mahesh


I think it's related to this issue: https://github.com/python-pillow/Pillow/issues/6015.

Running: pip install pillow==9.0.0 should fix it.

like image 43
lcard Avatar answered Feb 03 '26 06:02

lcard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!