-
Notifications
You must be signed in to change notification settings - Fork 23
ImportError: cannot import name '_mplcairo' from partially initialized module 'mplcairo' #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What are the contents of |
$ ls -l ~/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mplcairo/
total 64
-rw-r--r-- 1 sbasu1 staff 3234 2023 Sep 13 09:18:58 __init__.py
drwxr-xr-x 14 sbasu1 staff 448 2023 Sep 13 09:18:58 __pycache__
-rw-r--r-- 1 sbasu1 staff 664 2023 Sep 13 09:18:58 _backports.py
-rw-r--r-- 1 sbasu1 staff 2422 2023 Sep 13 09:18:58 _util.py
-rw-r--r-- 1 sbasu1 staff 155 2023 Sep 13 09:18:58 _version.py
-rw-r--r-- 1 sbasu1 staff 17664 2023 Sep 13 09:18:58 base.py
-rw-r--r-- 1 sbasu1 staff 1373 2023 Sep 13 09:18:58 gtk.py
-rw-r--r-- 1 sbasu1 staff 1486 2023 Sep 13 09:18:58 gtk_native.py
-rw-r--r-- 1 sbasu1 staff 605 2023 Sep 13 09:18:58 macosx.py
-rw-r--r-- 1 sbasu1 staff 2131 2023 Sep 13 09:18:58 multipage.py
-rw-r--r-- 1 sbasu1 staff 2219 2023 Sep 13 09:18:58 qt.py
-rw-r--r-- 1 sbasu1 staff 815 2023 Sep 13 09:18:58 tk.py
-rw-r--r-- 1 sbasu1 staff 1385 2023 Sep 13 09:18:58 wx.py $ pip install -v mplcairo
Using pip 23.2.1 from /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip (python 3.11)
Collecting mplcairo
Using cached mplcairo-0.5-cp311-cp311-macosx_13_0_x86_64.whl
Requirement already satisfied: matplotlib>=2.2 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from mplcairo) (3.7.2)
Requirement already satisfied: pillow in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from mplcairo) (9.5.0)
Requirement already satisfied: pycairo>=1.16.0 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from mplcairo) (1.23.0)
Requirement already satisfied: contourpy>=1.0.1 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (1.0.7)
Requirement already satisfied: cycler>=0.10 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (4.42.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (1.4.5)
Requirement already satisfied: numpy>=1.20 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (1.25.2)
Requirement already satisfied: packaging>=20.0 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (23.1)
Requirement already satisfied: pyparsing>=2.3.1 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (3.1.1)
Requirement already satisfied: python-dateutil>=2.7 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=2.2->mplcairo) (2.8.2)
Requirement already satisfied: six>=1.5 in /Users/sbasu1/packages/macports/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib>=2.2->mplcairo) (1.16.0)
Installing collected packages: mplcairo
Successfully installed mplcairo-0.5 |
Ugh, clearly something went wrong with the compilation. |
The first suggestion, |
FYI, this bug is still there. I just installed |
For me your installation solution fails at Not sure if there is something subtle I am missing, but I can import cairo in a script |
Is there no traceback at all? |
Why don't I dump the whole output
|
On Windows this will indeed not work: see the instructions at https://github.com/matplotlib/mplcairo?tab=readme-ov-file#windows instead. |
I recently installed mplcairo 0.5 on MacOS with
pip install mplcairo
. However, when I try to import it, I get:I am using python 3.11.5.
The text was updated successfully, but these errors were encountered: