Page 2 of 2

Re: Help: pyopenssl (python-ssl) not installed

Posted: March 8th, 2016, 9:31 am
by susron
Yes, as I said. I was testing 1.0.0RC1 which used SABnzbd.py
but to keep things clear, I reverted to sabnzbdplus from the ubuntu package

All vestiges of 1.0.0Rc1 are removed.

Code: Select all

sudo apt-get purge sabnzbdplus
sudo apt-get install sabnzbdplus
set user in /etc/default/sabnzbdplus
set host in defaults 192.168.1.149
set port in defaults 8085

BAD - No openssl.

Code: Select all

sudo systemctl start sabnzbdplus
GOOD - openssl fine

Code: Select all

/usr/bin/python /usr/bin/sabnzbdplus --config-file /home/USER/.sabnzbd/sabnzbd.ini --server 192.168.1.149:8085

Re: Help: pyopenssl (python-ssl) not installed

Posted: March 8th, 2016, 9:56 am
by sander
I see. That's different than I understood you earlier.

With this information, I would do this:

Code: Select all

python -c "import sys; print sys.path; import OpenSSL; print OpenSSL.__file__ ;  print '\n\nBye ...' "
and

Code: Select all

sudo python -c "import sys; print sys.path; import OpenSSL; print OpenSSL.__file__ ;  print '\n\nBye ...' "
Post the output here.

Here's mine:

Code: Select all

sander@haring:~$ python -c "import sys; print sys.path; import OpenSSL; print OpenSSL.__file__ ; print '\n\nBye ...' "
['', '/usr/local/lib/python2.7/dist-packages/gspread-0.2.2-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/shodan-1.3.4-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/click-4.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/CherryPy-3.8.0-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']
/usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc


Bye ...
resp

Code: Select all

sander@haring:~$ sudo python -c "import sys; print sys.path; import OpenSSL; print OpenSSL.__file__ ; print '\n\nBye ...' "
['', '/usr/local/lib/python2.7/dist-packages/gspread-0.2.2-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/shodan-1.3.4-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/click-4.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/CherryPy-3.8.0-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']
/usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc


Bye ...

Re: Help: pyopenssl (python-ssl) not installed

Posted: April 3rd, 2016, 1:49 am
by eatjello
I was having the same issue, and it came down to the optimization flags. Running the following from the CLI worked.

Code: Select all

/usr/bin/python /usr/bin/sabnzbdplus --config-file /opt/sabnzbd/sabnzbd.ini --server x.x.x.x:yyyy
However, running the next bit failed in the same way as it does when run as a service.

Code: Select all

/usr/bin/python -OO /usr/bin/sabnzbdplus --config-file /opt/sabnzbd/sabnzbd.ini --server x.x.x.x:yyyy
Apparently, the optimization flag is breaking the lookup for pyopenssl. Perhaps the it ignores the pyc file and can't locate a corresponding pyo? Regardless, the fix for me was to remove "-OO" from the first line of /usr/bin/sabnzbdplus. Now everything is back to normal...

Re: Help: pyopenssl (python-ssl) not installed

Posted: April 3rd, 2016, 1:56 am
by sander
Apparently, the optimization flag is breaking the lookup for pyopenssl. Perhaps the it ignores the pyc file and can't locate a corresponding pyo? Regardless, the fix for me was to remove "-OO" from the first line of /usr/bin/sabnzbdplus. Now everything is back to normal...
Could you run these commands to see if there is a difference in the output?

Code: Select all

python -c "import sys; print sys.path; import OpenSSL; print OpenSSL.__file__ ;  print '\n\nBye ...' "

Code: Select all

python -OO -c "import sys; print sys.path; import OpenSSL; print OpenSSL.__file__ ;  print '\n\nBye ...' "
and post the output here.

Re: Help: pyopenssl (python-ssl) not installed

Posted: April 3rd, 2016, 1:32 pm
by shypike
The only real difference the -OO flag makes is the removal of document strings.
It may be that some badly designed modules cannot handle that.
Although we've always used the -OO flag...

Re: Help: pyopenssl (python-ssl) not installed

Posted: April 3rd, 2016, 3:56 pm
by sander
shypike wrote:The only real difference the -OO flag makes is the removal of document strings.
It may be that some badly designed modules cannot handle that.
Although we've always used the -OO flag...
From 'python --help':

Code: Select all

-O     : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x
-OO    : remove doc-strings in addition to the -O optimizations
So -OO implies -O.

Still a long shot, so let's wait for the @eatjello to run the commands I gave to see if his hypothesis is correct.

Re: Help: pyopenssl (python-ssl) not installed

Posted: April 19th, 2016, 7:11 am
by Spunky
I've encountered this same issue, looks like I somehow installed PyOpenSSL with both apt and pip. Solution was to remove both, then reinstall with apt:

pip uninstall pyOpenSSL
apt-get remove python-openssl
apt-get install python-openssl

How I got into this mess, I honestly don't know.

Re: Help: pyopenssl (python-ssl) not installed

Posted: April 23rd, 2016, 12:33 am
by ZlatkO
Same/similar issue here. Had to upgrade from pyOpenSSL-0.13 to pyOpenSSL-16.0.0 as the minimum requirement was raised to >=0.15. The upgrade/installation itself was not a problem, however the newly installed pyOpenSSL version simply didn't work because of missing dependencies, which were not checked properly during build/install (I did install from source, using the standard "python setup.py" way). Using a python shell interactively and trying "from OpenSSL import crypto" until it finally worked, I installed the missing dependencies step by step.

Here's the complete list that I needed (Python-2.6.2 on Slackware 13), your requirements may vary depending on your OS & Python versions:

Code: Select all

SABnzbd-1.0.0
pyOpenSSL-16.0.0
six-1.10.0
cffi-1.6.0
pycparser-2.14
cryptography-1.3.1
enum-0.4.6
HTH! :)