ImportError : image not found when I use Python library--pymrmr - python

pymrmr version - 0.1.8
Python version -3.6
OS - Mac OS 10.14.5
I want to use a Python library ---pymrmr.
after installing, I get a ImportError when importing it:
import pymrmr
ImportError:
dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymrmr.cpython-36m-darwin.so,
2): Library not loaded: /usr/local/opt/libiomp/lib/libiomp5.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymrmr.cpython-36m-darwin.so
Reason: image not found
I tried some solutions:
brew install libomp
and
brew install llvm
but none works for me.
and I find that the category----/usr/local/opt/libiomp/ does not exists
Only this directory exists ----- /usr/local/opt/libomp/lib/libomp.dylib
Is there something wrong here?
Hope everyone can give me ideas.
Thanks in advance!

Related

ImportError: cannot import name 'parse_dict' from 'psqlparse'

I am trying to import parse_dict from by psqlparse:
from psqlparse import parse_dict
Then there is an error below that I cannot seem to find mentioned by anyone on the internet. Does anyone have an idea? Thank you! I am using Python 3.8.5 on Ubuntu 20.04
The error is:
ImportError: cannot import name 'parse_dict' from 'psqlparse' (/home/name/.local/lib/python3.8/site-packages/psqlparse/__init__.py)
It seems there are two versions of psqlparse - default but old 0.2.5 and unofficial (Release Candidate) but the newest 1.0.rc7. Old version doesn't have parse_dict but new one has it.
You can (re)install it with
pip install -U psqlparse==1.0rc7
BTW:
If you try to install wrong version - ie. pip install psqlparse==hello - then it displays error message with all avaliable versions and you can see which version you can install.

anaconda_build tutorial fails on MacOS High Sierra: Library not loaded: libcrypto.1.0.0.dylib

I am following this official guide for building a package for anaconda based on a skeleton. I just want to build the example package used in the tutorial, which is pyinstrument.
I am using anaconda2 version 4.5.11 under MacOS High Siera (10.13.6).
When running the command conda_build pyinstrument, I am getting the following error (full output here):
File
"/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cffi/vengine_cpy.py",
line 159, in load_library
raise VerificationError(error) cffi.error.VerificationError: importing
'/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_4ed9e37dx4000d087.so':
dlopen(/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_4ed9e37dx4000d087.so,
2): Library not loaded: #loader_path/../../../libcrypto.1.0.0.dylib
Referenced from:
/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_4ed9e37dx4000d087.so Reason: image not found
I have already tried reinstalling openssl via brew, because I found this recommendation when searching SO for the error message, it had no effect on the error though. My openssl version from brew is 1.0.2p in case that matters.
What am I doing wrong?
I was able to finally resolve this issue. The solution was to manually install a package that seems to be required:
conda install cryptography

DLL load failed: The specified module could not be found

I have installed Python 3.6.4. When I import cv2, it throws this error:
DLL load failed: The specified module could not be found.
I have OpenCV version 2.4.13.
What should i do?
It's possible that you have Python 2 and 3 installed and Python 3 doesn't know about your opencv installation. Try this:
pip3 install opencv-python
That will install opencv for Python 3 and hopefully that fixes your problem.
Try doing this:
Go to command prompt and "cd" the directory of python.
Enter this if you are running Python 3.x.x
pip3 install opencv-python
OR
2.If on Python 2.x.x
pip2 install opencv-python
DO NOT USE:
pip install opencv
That was my mistake and had to dig a lot to find a solution.
In my situation,
ImportError Traceback (most recent call last)
in ()
10 import os.path
11 from keras.models import load_model
---> 12 import cv2
13 from utils.utils import get_yolo_boxes, makedirs
14 from PIL import Image
ImportError: DLL load failed: The specified module could not be found.
Face this ImportError in the pass week, and I solved with enter below scripts in the Anaconda Prompt.
conda install -c menpo opencv
And here is my environment:
Python 3.6.5 Anaconda
Keras 2.2.2
tensorflow 1.9.0
For more details, here is the log I tried to solved this ImportError:
micky619/holiday-similarity#3
This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.
The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack
Be careful to choose the version that works with your current version of windows.
If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9
If the problem still persists try using Dependency walker to find out where specifically your problems stem from and then try fixing them individually.
Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.

Python wkhtmltopdf can't import module

I am using Python version 3.6, Django version 1.9 and wkhtmltopdf version 0.2. My Python is not GCC it's Anaconda3.
When running my project which uses wkhtmltopdf, following error will be thrown:
from main import WKhtmlToPdf, wkhtmltopd
ModuleNotFoundError: No module named 'main'
This is how I imported the wkhtmltopdf:
import pdfkit
from wkhtmltopdf.views import PDFTemplateView
Yes i got the answer. This error occurred because i didn't installed django-wkhtmltopdf.
installed >> `pip install django-wkhtmltopdf
I hope this answer will help to resolve the similar error.
after installing pdfkit with following command and pointing python version 3.8, i was able to get pdfkit working on mac
pip3 install pdfkit

Pyinstaller troubles with Pillow

I'm trying to use pyinstaller, on OSX Mavericks, with one a Python script. Pyinstaller compiles and packs along until it finds an error with the Pillow library.
ImportError: dlopen(/Users/Rodolphe/.python-eggs/Pillow-2.2.1-py2.7-macosx-10.9-intel.egg tmp/PIL/_imaging.so, 2): Library not loaded: /usr/local/lib/libjpeg.8.dylib
Referenced from: /Users/Rodolphe/.python-eggs/Pillow-2.2.1-py2.7-macosx-10.9-intel.egg-tmp/PIL/_imaging.so
Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0
It looks like Pyinstaller and Pillow are not getting along (it seems to be a known fact: http://www.pyinstaller.org/ticket/745 ). Is there a way around it? Should I try uninstalling Pillow and installing Pil instead (I chose Pillow out of discouragement from Pil's reluctancy to install on Mavericks, to begin with)? Or maybe update libjpeg.8.dylib to version 13.0.0 as it seems to be the problem?
[EDIT]
I have updated libjepeg thanks to the advice from #mimi.vx I now have another error at the very end of the process:
IOError: [Errno 20] Not a directory: '/Library/Python/2.7/site-packages/Pillow-2.2.1-py2.7-macosx-10.9-intel.egg/PIL/_imaging.so'
I tried reinstalling Pillow so Pyinstaller would maybe get the directory, but no luck yet...
[RE-EDIT]
Using py2app instead of pyinstaller worked for me!
Yes, first try update libjpeg
Good help for OS X can be found in this blog http://brantsteen.com/blog/python-27-libjpeg-pil-on-osx/
libjpg latest source is here www.ijg.org
And Pillow recommended install on OS X is described in pypi.python.org/pypi/Pillow/2.2.1
It is over homebrew $ brew install libtiff libjpeg webp littlecms
Pyinstaller was behaving strangely while importing PIL. I tried using py2app ( http://pythonhosted.org/py2app/ ) instead, and it worked like a charm. No lib ray import trouble or anything. I'd recommend it.

Categories

Resources