cryptography - Import issue with Python six library -


inside virtualenv have lot of libraries use six dependency paramiko , python-keystoneclient raise import error:

error:paramiko.transport:unknown exception: cannot import name urllib_parse error:paramiko.transport:traceback (most recent call last): error:paramiko.transport:  file "/.../lib/python2.7/site-packages/paramiko/transport.py", line 1772, in run error:paramiko.transport:    self.kex_engine.parse_next(ptype, m) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/paramiko/kex_group1.py", line 75, in parse_next error:paramiko.transport:    return self._parse_kexdh_reply(m) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/paramiko/kex_group1.py", line 111, in _parse_kexdh_reply error:paramiko.transport:    self.transport._verify_key(host_key, sig) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/paramiko/transport.py", line 1617, in _verify_key error:paramiko.transport:    key = self._key_info[self.host_key_type](message(host_key)) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/paramiko/rsakey.py", line 58, in __init__ error:paramiko.transport:    ).public_key(default_backend()) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", line 35, in default_backend error:paramiko.transport:    _default_backend = multibackend(_available_backends()) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", line 22, in _available_backends error:paramiko.transport:    "cryptography.backends" error:paramiko.transport:  file "/.../lib/python2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve error:paramiko.transport:    module = __import__(self.module_name, fromlist=['__name__'], level=0) error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module> error:paramiko.transport:    cryptography.hazmat.backends.openssl.backend import backend error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 15, in <module> error:paramiko.transport:    cryptography import utils, x509 error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/x509/__init__.py", line 7, in <module> error:paramiko.transport:    cryptography.x509.base import ( error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/x509/base.py", line 15, in <module> error:paramiko.transport:    cryptography.x509.extensions import extension, extensiontype error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/x509/extensions.py", line 22, in <module> error:paramiko.transport:    cryptography.x509.general_name import generalname, ipaddress, othername error:paramiko.transport:  file "/.../lib/python2.7/site-packages/cryptography/x509/general_name.py", line 15, in <module> error:paramiko.transport:    six.moves import urllib_parse error:paramiko.transport:importerror: cannot import name urllib_parse 

i went through internet find way fix problem without solving it.

i tried these steps:

  • re-install libraries involved
  • re-install virtualenv
  • tried several older 6 versions

these versions of libraries:

  • cryptography==1.4
  • keystoneauth1==2.8.0
  • paramiko==2.0.1
  • python-keystoneclient==3.1.0
  • python-swiftclient==3.0.0
  • six==1.10.0
  • urllib3==1.16

and got same issue these python versions:

  • python 2.7.11+ --> ubuntu 16.04
  • python 2.7.10 --> ubuntu 15.10

if try

from six.moves import urllib_parse 

inside python shell, works correctly.

do have idea? in advance!

try downgrade paramiko 1.16.0. solution in case. luck!


Comments

Popular posts from this blog

How to start daemon on android by adb -

testing - Detect whether test has failed within fixture -

Angularjs unit testing - ng-disabled not working when adding text to textarea -