Help: pyopenssl (python-ssl) not installed

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
susron
Newbie
Newbie
Posts: 4
Joined: March 5th, 2016, 2:55 am

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

Post 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
User avatar
sander
Release Testers
Release Testers
Posts: 9261
Joined: January 22nd, 2008, 2:22 pm

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

Post 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 ...
eatjello
Newbie
Newbie
Posts: 1
Joined: April 3rd, 2016, 1:43 am

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

Post 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...
User avatar
sander
Release Testers
Release Testers
Posts: 9261
Joined: January 22nd, 2008, 2:22 pm

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

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post 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...
User avatar
sander
Release Testers
Release Testers
Posts: 9261
Joined: January 22nd, 2008, 2:22 pm

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

Post 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.
Spunky
Newbie
Newbie
Posts: 1
Joined: April 19th, 2016, 7:09 am

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

Post 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.
User avatar
ZlatkO
Newbie
Newbie
Posts: 18
Joined: April 22nd, 2016, 11:57 pm

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

Post 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! :)
Post Reply