Did a pull request this morning after the Clarifai API update. I then ran the clarifai upgrade. I started getting the following error below.
Traceback (most recent call last):
File "IG-OriginalRandom.py", line 2, in
from instapy import InstaPy
File "/home/bn/InstaPy/instapy/__init__.py", line 1, in
from .instapy import InstaPy
File "/home/bn/InstaPy/instapy/instapy.py", line 15, in
from .clarifai_util import check_image
File "/home/bn/InstaPy/instapy/clarifai_util.py", line 3, in
from clarifai import rest
File "build/bdist.linux-x86_64/egg/clarifai/rest/__init__.py", line 3, in
File "build/bdist.linux-x86_64/egg/clarifai/rest/client.py", line 13, in
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 52, in
from .packages.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 47, in
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
sudo pip install --upgrade clarifai
Requirement already up-to-date: clarifai in /usr/local/lib/python3.5/dist-packages
Requirement already up-to-date: future==0.15.2 in /usr/local/lib/python3.5/dist-packages (from clarifai)
Requirement already up-to-date: requests==2.13.0 in /usr/local/lib/python3.5/dist-packages (from clarifai)
Requirement already up-to-date: configparser==3.5.0 in /usr/local/lib/python3.5/dist-packages (from clarifai)
Requirement already up-to-date: jsonschema==2.5.1 in /usr/local/lib/python3.5/dist-packages (from clarifai)
Requirement already up-to-date: enum34==1.1.6 in /usr/local/lib/python3.5/dist-packages (from clarifai)
Requirement already up-to-date: Pillow==2.9.0 in /usr/local/lib/python3.5/dist-packages (from clarifai)
python -V
Python 2.7.12
pip freeze | grep -iE 'crypto|ssl'
asn1crypto==0.22.0
cryptography==2.0.3
pycrypto==2.6.1
pyOpenSSL==17.2.0
openssl version
OpenSSL 1.0.2g 1 Mar 2016
So this is still an issue for me, but I wanted to update my progress. I was able to fix the pyopenssl error by doing the following reinstall
sudo rm -rf /usr/local/lib/python2.7/dist-packages/OpenSSL/
python -m easy_install --upgrade pyOpenSSL
I am now getting the following error when I run my instapy script:
Traceback (most recent call last):
File "IG-Random-test.py", line 2, in
from instapy import InstaPy
File "/home/bn/InstaPy/instapy/__init__.py", line 1, in
from .instapy import InstaPy
File "/home/bn/InstaPy/instapy/instapy.py", line 15, in
from .clarifai_util import check_image
File "/home/bn/InstaPy/instapy/clarifai_util.py", line 3, in
from clarifai import rest
File "build/bdist.linux-x86_64/egg/clarifai/rest/__init__.py", line 3, in
File "build/bdist.linux-x86_64/egg/clarifai/rest/client.py", line 17, in
ImportError: No module named configparser
I was able to get the script to run by commenting out line 15 in the /instapy/instapy.py script
from .clarifai_util import check_image
With the above line commented out my script seems to work, but I would like to take advantage of the Clarifai picture scanning. I will keep working on trying to fix this.
Does anyone have any suggestions?
So I was not able to get around this issue, I reinstalled my Virtual Machine and Clarifai is now working as expected
I saw the AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
error too and sudo pip install pyOpenSSL==16.2.0
resolved it for me!