This is the error I am getting:
ImportError: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not
found (required by
/home/anaconda2/lib/python2.7/site-packages/matplotlib/../../.././libpng16.so.16)
Problem solved. It turned out that my version of libpng was looking for the older version of zlib. I reinstalled(updated) libpng and things are working correctly now.
For my conda environment 4.5.11 (miniconda2), I had the same error `ZLIB_1.2.9' not found.. etc.. /site-packages/matplotlib/../../.././libpng16.so.16). I was not able upgrade, since 1.16.35 was not yet available from conda. For my solution, I kept downgrading libpng to version 1.6.30, and downgraded matplotlib=2.0.2.
I do not like downgrading, however, to keep my operational environment to work, it was necessary. I am trying to automate my deployments and was not happy that I had to manually intervene. I like using conda, since it typically manages the matplotlib install very well, however, it the nature of the beast for open source to have upgrade/downgrade issues.
In conclusion, ZLIB is really not the issue, but what versions of matplotlib you are running. You just have to try upgrading and downgrading packages to get a good fit for matplotlib.
As a reference, I also encountered the same problem, so I report the solution in case it can help someone.
It appeared to be some incompatibilities between pyqtgraph and matplotlib. Importing matplotlib before pyqtgraph solved the problem.
matplotlib version: '3.3.1'
pyqtgraph version: '0.11.0'
Related
I'm trying to run python in RStudio in a RMarkdown file using the reticulate package. I have attached a python conda environment to work in. When I'm trying to import pandas or numpy, I'm getting the following error -
RuntimeError: The current Numpy installation ('/opt/anaconda3/envs/env1/lib/python3.8/site-packages/numpy/__init__.py') fails to pass simple sanity checks. This can be caused for example by incorrect BLAS library being linked in, or by mixing package managers (pip, conda, apt, ...). Search closed numpy issues for similar problems.
I searched far and wide online and could not find an existing solution. I found solutions where it is mentioned that this issue occurs in Numpy=1.19.3, however, I'm using Numpy=1.22.2 and I could not find a solution for my specific use case.
OS : Ubuntu 18.04.6 LTS (Bionic Beaver)
Python: Python 3.8.5
R: 4.1.2
RStudio server version: Version 1.4.1106
R Code that I'm using in the RMarkdown notebook:
{r chunk}
Sys.setenv(RETICULATE_PYTHON = "/opt/anaconda3/envs/env1/bin/python")
library(reticulate)
reticulate::use_condaenv("env1")
{python chunk}
import pandas
This question has been asked in the RCommunity page (https://community.rstudio.com/t/numpy-install-with-reticulate-fail-sanity-check/141224), however has not been answered. Has anyone solved for / can anyone help with this issue? TIA
Reinstalling Numpy using conda instead of pip resolved this issue.
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
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
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)
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.
I wanted to change my python compiler to "newer" one (within one project) and use some additional packages with conda. After the installation all my packages worked fine and I could use the console, however matplotlib.pyplot fails to import since then. And throws the following error: app = QtGui.QApplication([" "])
AttributeError: module 'PyQt5.QtGui' has no attribute 'QApplication'
After doing some research on this I found this one: link
It is suggesting to change inputhooks.py (on line 513 and change GUI_QT:enable_qt4 to GUI_QT: enable_qt5 4 to 5)
As it is a company machine, I can't have admin rights to overwrite things within PyCharm.
Can you recommend a better solution to avoid this?
Why is this popping up?
ErrorLogScreenshot
Also I tried to install the newer version of pyqt but that didn't fix the problem.
In the same time
Within pydev the interactiveshell.py fails as well. with the following error message:self.showtraceback(running_compiled_code=True)
TypeError: showtraceback() got an unexpected keyword argument 'running_compiled_code'
I understand it gets an argument which it is not expecting. I did some research on this one as well and some could fix it by deleting a stale a corresponding .pyc file (I couldn't find one at the same location as the initial file only interactiveshell.py)
Below this blog regarding pydev the conversation never went further
https://github.com/ipython/ipython/issues/10687
Is there a way to fix it?
I am kind of new to Python and don't quite understand the heart of it at this depth so any help is appreciated.
Thanks,
Anna
For anyone having the same issue, I have solved this problem by switching to qt and pyqt 4. To do so, follow the following procedure:
conda remove qt
conda install qt=4
conda install -c anaconda pyqt=4.11.4
conda install matplotlib --no-update-dependencies
If you are not using a virtual environment, you might also have to remove anaconda navigator before installing new packages:
conda uninstall anaconda-navigator
At the beginning of your program, switch matplotlib backend:
import matplotlib.pyplot as plt
plt.switch_backend('Qt4Agg')
Inspired by this solution.
After updating PyCharm all issues seem to have been resolved. (I was using versin 2017.1)
The show traceback error was due to pydev, and the new release fixes it.
As well as the GUI problem.
I was able to solve it by finding the file, and both messages disappeared, and matplotlib seems to work fine again.
Under this folder (I named my environment py35):
C:\Users\myusername\AppData\Local\Continuum\anaconda3\envs\py35\Lib\site-packages\IPython\core__pycache__
I found the file: interactiveshell.cpython-35.pyc and deleted it -
(This solves the problem only on Python 3.5)
I encountered the same
ValueError: scoring must return a number, got [...] (<class 'numpy.core.memmap.memmap'>) instead.
error as discussed in Q34857870.
Based on answers to this question, and my own research, I believe this issue to be fixed in scikit-learn version 0.17.1, though I'm still encountering it. Then I noticed something strange.
conda lists the right version.
$ conda list scikit-learn
packages in environment:
scikit-learn 0.17.1 np111py27_0
My Jupyter notebook gives the right version:
%load_ext watermark
%watermark scikit-learn
scikit-learn 0.17.1
But I get a different version when I check the version within my code:
import sklearn
print(sklearn.__version__)
0.17
I wouldn't think anything of this, except I'm still seeing a bug in 0.17 that should have been fixed in 0.17.1, so I'm wondering whether I'm using the wrong version somehow.
I'm wondering if it is somehow connected to Q30666685.
You probably have multiple versions of scikit learn installed. You can see where it is installed by using
print(sklearn.__file__)
and then simply delete that. In case if you are still having version troubles work within a virtual environment.
I've been struggling for hours on a problem that is making me insane. I installed Python 2.7 with Cygwin and added Scipy, Numpy, Matplotlib (1.4.3) and Ipython. When I decided to run ipython --pylab I get the following error:
/usr/lib/python2.7/site-packages/matplotlib/transforms.py in <module>()
37 import numpy as np
38 from numpy import ma
----> 39 from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
40 update_path_extents)
41 from numpy.linalg import inv
ImportError: No module named _path
I spent hours on the internet, looking for a solution but nothing worked. I did notice that I am missing _path.so files in the matplotlib directory that everybody seems to have. Instead, I have two files: path.py and path.pyc. But I installed matplotlib directly from the official website using pip install and reinstalling it didn't make any difference. Does anyone have a little clue on what is going wrong? I would be incredibly grateful !!!
For others having this problem, in my case, the solution was simple. The problem was caused by having the wrong matplot library installed on your computer; creating an error in finding the correct matplotlib path. In my case, I had installed matplotlib on a different version of python. Simply update matplotlib on your computer, so that it is compatible with your current version of python:
pip install --upgrade matplotlib
As for the post, I am unsure of what caused these big issues. Hope my tip can help anyone else stumbling upon this issue!
I doubt that most of you brought here by Google have the problem I had, but just in case:
I got the above "ImportError: No module named _path" (on Fedora 17) because I was trying to make use of matplotlib by just setting sys.path to point to where I had built the latest version (1.5.1 at the time). Don't do that.
Once I ran "python setup.py install" (as root) to do a proper install (and got rid of my sys.path hack), the error was fixed.
The package matplotlib requires multiple dependencies (see them here). For me, the missing dependencies included pyparsing and kiwisolver, but your results my vary. Before you do any of these other things (reinstalling python or the library, etc...), make sure you have installed (pip install ...) all the libs in this list (link).