Openssl issue with python 3.8 - python

I am trying to use a python package wptools. When I do I get this error:
import pycurl
ImportError: dlopen(/Users/c/.virtualenvs/j/lib/python3.8/site-packages/pycurl.cpython-38-darwin.so, 2): Library not loaded: #rpath/libssl.1.1.dylib
Referenced from: /Users/c/.virtualenvs/j/lib/python3.8/site-packages/pycurl.cpython-38-darwin.so
Reason: image not found
I have tried all kinds of things, such installing with brew install openssl. What is weird is when I open a terminal on my mac, which uses python 3.7.6, it works. But when I try it in a virtual env, which is 3.8.10, it does not work. Any ideas?

Related

Import error with OPENCV in Python on M1 Mac

I'm trying to use OpenCV with Python but I'm continuously getting errors while importing. I'm using Anaconda virtual env and ZSH on Mac M1.
I have tried installing it using
conda install -c anaconda opencv
and pip3 install opencv-python
but I'm getting this error:
from .cv2 import * ImportError: dlopen(/Users/username/Library/Python/3.8/lib/python/site-packages/cv2/cv2.cpython-38-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/ffmpeg/lib/libavcodec.58.dylib Referenced from: /Users/username/Library/Python/3.8/lib/python/site-packages/cv2/cv2.cpython-38-darwin.so Reason: tried: '/opt/homebrew/opt/ffmpeg/lib/libavcodec.58.dylib' (no such file), '/usr/local/lib/libavcodec.58.dylib' (no such file), '/usr/lib/libavcodec.58.dylib' (no such file)
First you should make sure that ffmpeg is installed.
for me the issue was that the ffmpeg which I had installed by brew was named like ffmpeg#4 in opt/homebrew/opt/ so it couldn't find it.
I renamed the folder to ffmpeg and the issue was fixed.

Pycurl is installed on my computer, but is not being recognised or found in PyCharm

i have been writing a script in python in the IDE PyCharm , but pycurl is not being imported. This is the error which I recieve:
ImportError: dlopen(/Users/danielraad/PycharmProjects/VisualiseGrocery/venv/lib/python3.7/site-packages/pycurl.cpython-37m-darwin.so, 2): Library not loaded: #rpath/libssl.1.1.dylib
Referenced from: /Users/danielraad/PycharmProjects/VisualiseGrocery/venv/lib/python3.7/site-packages/pycurl.cpython-37m-darwin.so
Reason: image not found
despite the fact that pip install pycurl returns Requirement already satisfied. I've tried to import it using the project interpreter through systems preferences but this hasnt changed anything.
I am running Python version 3.7
Would appreciate any help.

import pycurl: Library not loaded: #rpath/libcrypto.1.1.dylib : Reason: image not found

My flask app python code error's out with below error :
Traceback (most recent call last):
File "######.py",
import pycurl
ImportError: dlopen(/Users/########/Library/Python/3.7/lib/python/site-packages/pycurl.cpython-37m-darwin.so, 2): Library not loaded: #rpath/libcrypto.1.1.dylib
Referenced from: /Users/########/Library/Python/3.7/lib/python/site-packages/pycurl.cpython-37m-darwin.so
Reason: image not found
OS: Darwin Kernel Version 18.6.0 - Mojave 10.14.5
Tried updating brew,
openssl (link and unlink, export LDFLAGS, export CFFFLAGS) but nothing appears to work
$ brew install openssl
openssl 1.0.2s is already installed and up-to-date
$brew install curl-openssl
curl-openssl 7.65.3 is already installed and up-to-date
Any additional pointers to try. Thanks in advance
What solved it in my case was changing the path where Python would look for this libs, as they were installed by brew. But you can tell it to look for the lib somewhere else:
Add the following at the bottom of your profile file (~/.bashrc or ~/.zshrc, depending on your shell):
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib
Then restart your shell, and try again (remember to reload your venv if your were using one).

ImportError: No module named cv2 after install VS2017

Before:
Install VS2015.
Install opencv 3.2.0.
Now, i install VS2017 and create python project with the following code:
import cv2
When I run it, compiler show the error: "ImportError: No module named cv2"
How to update some libraries - which i installed before - as opencv, numpy,... for VS2017?
Thanks!
UPDATE 1
I knew the reason. Because when i installed VS2017, i also installed other version of Python. VS2017 used the wrong version (it does not have opencv library). And then i created new universal windows python project, VS2017 auto generate PythonUwpIoT (python 3.5 - i don't know and how to have it).

Can't Import lp_solve in anaconda (python2)

I installed lpsolve55 in anaconda using conda. The package wasn't available in the official repository, so I installed it from another user's. However, I can't import it into anaconda. When I try, it gives me this error:
ImportError: libcolamd.so.2.7.1: cannot open shared object file: No
such file or directory
I've tried googling but came up short. Any ideas?

Categories