Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name '_counter' from 'Crypto.Util'

I am on Linux Ubuntu 18.04 LTS and using the Geanny editor with the python 3.7 interpreter. I was trying to use AES 256 bit encryption. I researched this problem all over the internet and tried various different solutions but to no avail. The error I continue to get is

ImportError: cannot import name '_counter' from 'Crypto.Util' (/usr/lib/python3/dist-packages/Crypto/Util/__init__.py).

Any suggestions or ideas of a solution to this problem?

like image 878
William Davenport Avatar asked Mar 01 '19 05:03

William Davenport


1 Answers

Try:

sudo pip install pycrypto pycryptodomex

If still not working:

sudo pip uninstall pycrypto pycryptodomex

sudo pip install pycryptodome

Note that pycrypto and pycryptodome will interfere with each other

One must avoid having both PyCrypto and PyCryptodome installed at the same time, as they will interfere with each other.

(source)

like image 96
Ron Kalian Avatar answered Sep 21 '22 23:09

Ron Kalian