mozilla/cipherscan

ImportError: cannot import name python_2_unicode_compatible on macOS

jozefizso opened this issue · 6 comments

When I run cipherscan on macOS 10.14.5 with bash 4 installed using homebrew, I get this error:

./cipherscan server01:443
.........................Traceback (most recent call last):
  File "cscan.py", line 6, in <module>
    from tlslite.messages import ClientHello, ServerHello, ServerHelloDone, Alert
  File "/Users/jozef/Projects/github/cipherscan/tlslite/__init__.py", line 27, in <module>
    from tlslite.api import *
  File "/Users/jozef/Projects/github/cipherscan/tlslite/api.py", line 5, in <module>
    from .constants import AlertLevel, AlertDescription, Fault
  File "/Users/jozef/Projects/github/cipherscan/tlslite/constants.py", line 11, in <module>
    from .utils.compat import a2b_hex
  File "/Users/jozef/Projects/github/cipherscan/tlslite/utils/compat.py", line 13, in <module>
    import ecdsa
  File "/Users/jozef/Projects/github/cipherscan/ecdsa/__init__.py", line 1, in <module>
    from .keys import SigningKey, VerifyingKey, BadSignatureError, BadDigestError
  File "/Users/jozef/Projects/github/cipherscan/ecdsa/keys.py", line 3, in <module>
    from . import ecdsa
  File "/Users/jozef/Projects/github/cipherscan/ecdsa/ecdsa.py", line 57, in <module>
    from . import ellipticcurve
  File "/Users/jozef/Projects/github/cipherscan/ecdsa/ellipticcurve.py", line 37, in <module>
    from six import python_2_unicode_compatible
ImportError: cannot import name python_2_unicode_compatible
..........
Target: server01:443

that would indicate than six package is too old, try updating it

I installed the latest version and the error is still present.

both for python2 and python3?

i have the same problem.

This error happens only when the python used by cipherscan has six that is older than 1.9.0. Install newer version of six.

See python-ecdsa setup.py file:
https://github.com/warner/python-ecdsa/blob/aea736c610752bf1478febfd15b11c711debcf61/setup.py#L43

I had same message in Django 3.0. I have installed Django 2.2.9. Error is resolved now.