AttibuteError: 'module' object has no attribute 'rand' has occured at acme/acme/crypto_util.py with >=pyOpenSSL-17.2.0
'module' object has no attribute 'rand'
python - random.randint error: "AttributeError: 'module' object has no attribute 'randint'" - Stack Overflow
openssl - Python AttributeError: 'module' object has no attribute 'SSL_ST_INIT' - Stack Overflow
Upgrading pyopenssl with pip was not working as none of the commands related to to pip was working for me. By upgrading pyopenssl with easy_install, above problem can be solved.
sudo python -m easy_install --upgrade pyOpenSSL
credit @delimiter (Answer)
Turned out the problem was with my installation of pyOpenSSL, pyOpenSSL-0.15.1 .
I did:
pip uninstall pyopenssl
and then
pip install pyopenssl
...and my Python script worked again!
I'm supposed to be making a code that lets you play Rock-Paper-Scissors with the computer as part of my beginner exercises. Obviously this is gonna require me to import the random module to make the computer throw out different moves. So I first tested importing the module by making this simple code:
import random
print(random.randint(1,100))
But when I test it, the error written in the title shows up. My file is not named random.py to avoid conflicts with the imported module. Is there a workaround for this?