1

I have downloaded a project. I get the following error.

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2\helpers\pydev\pydevd.py", line 11, in <module>
    import traceback
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\traceback.py", line 5, in <module>
    import linecache
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\linecache.py", line 11, in <module>
    import tokenize
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\tokenize.py", line 35, in <module>
    from token import *
  File "C:\Projects\xx\auth\token.py", line 3, in <module>
    from jose.jwt import get_unverified_claims
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\jose\jwt.py", line 11, in <module>
    from jose import jws
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\jose\jws.py", line 8, in <module>
    from jose import jwk
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\jose\jwk.py", line 13, in <module>
    from Crypto.PublicKey import RSA
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\Crypto\PublicKey\RSA.py", line 78, in <module>
    from Crypto import Random
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\Crypto\Random\__init__.py", line 29, in <module>
    from Crypto.Random import _UserFriendlyRNG
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\Crypto\Random\_UserFriendlyRNG.py", line 32, in <module>
    import threading
  File "C:\Users\xx\AppData\Local\Programs\Python\Python36-32\lib\threading.py", line 7, in <module>
    from traceback import format_exc as _format_exc 
ImportError: cannot import name 'format_exc'
davidism
  • 121,510
  • 29
  • 395
  • 339
casillas
  • 16,351
  • 19
  • 115
  • 215
  • could you share the proyect? or is private or something? maybe silly comment, but did you try to remove that line? or rename the import? – developer_hatch Aug 03 '17 at 17:53
  • @DamianLattenero, this is built in into python threading.py. Do you think it is safe? – casillas Aug 03 '17 at 17:54
  • 6
    The problem is that your `auth/token.py` script is in python's import path. Either fix your import path or rename `token.py` to something else. – Aran-Fey Aug 03 '17 at 17:57
  • @Rawing good i was looking for the path dup, but I couldn't find it, you deserve greatness – developer_hatch Aug 03 '17 at 18:03
  • @Rawing how should I fix import path? token is getting called as follows `from token import *` – casillas Aug 03 '17 at 18:07
  • I select `Refactor > Rename` and `token` to `token_auth` and run I still see exactly same error. – casillas Aug 03 '17 at 18:13
  • 2
    @hotspring How to modify the import path (permanently) depends on your OS. Just google it. And then make sure to remove the `auth/` directory from the path. – Aran-Fey Aug 03 '17 at 18:13

0 Answers0