Page 1 of 1

Deluge woun't start - ImportError: cannot import name indexb

Posted: Mon Aug 17, 2015 3:25 pm
by rabin
I'm having a problem to run Deluge,
starting deluge from the command line will produce this stacktrace, which didn't help me to find any thing on Google.
I also tried to delete the configuration folder on my home folder, but didn't help either.

Code: Select all

~ » deluge

[ERROR   ] 22:14:09 ui:168 cannot import name indexbytes
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/deluge/ui/ui.py", line 149, in __init__
    from deluge.ui.gtkui.gtkui import GtkUI
  File "/usr/lib/python2.7/site-packages/deluge/ui/gtkui/__init__.py", line 1, in <module>
    from gtkui import start
  File "/usr/lib/python2.7/site-packages/deluge/ui/gtkui/gtkui.py", line 87, in <module>
    from deluge.ui.client import client
  File "/usr/lib/python2.7/site-packages/deluge/ui/client.py", line 37, in <module>
    from twisted.internet import reactor, ssl, defer
  File "/usr/lib64/python2.7/site-packages/twisted/internet/ssl.py", line 59, in <module>
    from OpenSSL import SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 10, in <module>
    from six import int2byte, indexbytes
ImportError: cannot import name indexbytes
[ERROR   ] 22:14:09 ui:169 There was an error whilst launching the request UI: gtk
[ERROR   ] 22:14:09 ui:170 Look at the traceback above for more information.

Re: Deluge woun't start - ImportError: cannot import name in

Posted: Mon Aug 17, 2015 4:16 pm
by doadin
looks like to me some deppendencies from modules OpenSSL loads is missing. try "sudo pip install pyopenssl" maybe?

Re: Deluge woun't start - ImportError: cannot import name in

Posted: Mon Aug 17, 2015 9:21 pm
by rabin
doadin wrote:looks like to me some deppendencies from modules OpenSSL loads is missing. try "sudo pip install pyopenssl" maybe?
I tried, didn't help

Code: Select all

# pip install -U pyopenssl 
Requirement already up-to-date: pyopenssl in /usr/lib/python2.7/site-packages
Requirement already up-to-date: cryptography>=0.7 in /usr/lib64/python2.7/site-packages (from pyopenssl)
Requirement already up-to-date: six>=1.5.2 in /usr/lib/python2.7/site-packages (from pyopenssl)
Requirement already up-to-date: idna>=2.0 in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyopenssl)
Requirement already up-to-date: pyasn1>=0.1.8 in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyopenssl)
Requirement already up-to-date: setuptools in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyopenssl)
Requirement already up-to-date: enum34 in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyopenssl)
Requirement already up-to-date: ipaddress in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyopenssl)
Requirement already up-to-date: cffi>=1.1.0 in /usr/lib64/python2.7/site-packages (from cryptography>=0.7->pyopenssl)
Requirement already up-to-date: pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.1.0->cryptography>=0.7->pyopenssl)

Re: Deluge woun't start - ImportError: cannot import name in

Posted: Mon Aug 17, 2015 10:14 pm
by Cas
Try updating six module, that is what is giving the "ImportError: cannot import name indexbytes". Have you read this: https://github.com/jstasiak/python-zeroconf/issues/21

Re: Deluge woun't start - ImportError: cannot import name in

Posted: Mon Aug 17, 2015 10:55 pm
by rabin
Cas wrote:Try updating six module, that is what is giving the "ImportError: cannot import name indexbytes". Have you read this: https://github.com/jstasiak/python-zeroconf/issues/21
Thanks, Yes I did found this page, and also tried to upgrade six, and as you can see from the above output "six" package is up2date.

but what i'm note sure about is the this, I run the commands mention by jstasiak on the above github issue, and got this resolt.

Code: Select all

» python -c "import six; print(six.__file__, six.__version__)"
('/usr/lib/python2.7/site-packages/six.pyc', '1.2.0')

» grep -n indexbytes `python -c "import six; print(six.__file__.replace('.pyc', '.py'))"`
(return nothing)
but from the output above `six` package should be on version 1.9.0

Code: Select all

---
Metadata-Version: 2.0
Name: six
Version: 1.9.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: benjamin@python.org
License: MIT
Location: /usr/lib/python2.7/site-packages
Requires: 

Re: Deluge woun't start - ImportError: cannot import name in

Posted: Mon Aug 17, 2015 11:06 pm
by rabin
--- UPDATE ---

The above answer made me think again about the file /usr/lib/python2.7/site-packages/six.pyc
so i remove six by running `pip uninstall six` and then reinstall the package again.

and now deluge is back and running again.

thanks