4
我的virtualenv中我有很多使用圖書館的的依賴,但的paramiko和蟒蛇,keystoneclient提出這個導入錯誤:進口問題
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: from 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: from cryptography import utils, x509
ERROR:paramiko.transport: File "/.../lib/python2.7/site-packages/cryptography/x509/__init__.py", line 7, in <module>
ERROR:paramiko.transport: from cryptography.x509.base import (
ERROR:paramiko.transport: File "/.../lib/python2.7/site-packages/cryptography/x509/base.py", line 15, in <module>
ERROR:paramiko.transport: from 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: from 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: from six.moves import urllib_parse
ERROR:paramiko.transport:ImportError: cannot import name urllib_parse
我經歷了互聯網尋找解決這個問題的方法而不解決它。
我已經嘗試過這些步驟:
- 重新安裝任何圖書館參與
- 重新安裝的virtualenv
- 試圖用幾個舊的六個版本
這些的版本庫:
- 加密== 1.4
- keystoneauth1 == 2.8.0
- 的paramiko == 2.0.1
- 蟒-keystoneclient == 3.1.0
- 蟒-swiftclient == 3.0.0
- 6 = = 1.10.0
- urllib3 == 1.16
,我得到了這些Python版本相同的問題:
- Python的2.7.11+ - > Ubuntu的16.04
- Python的2.7.10 - > Ubuntu的15.10
如果我嘗試
from six.moves import urllib_parse
Python的外殼內,它工作正常。
你有什麼想法嗎?提前致謝!
它的工作原理!非常感謝你@amazpyel! – alauri
不客氣! – amazpyel