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)

Answer from Muhammad Hassan on Stack Overflow
🌐
Stack Overflow
stackoverflow.com › questions › 73435633 › pip-or-pip3-broken-attributeerror-module-lib-has-no-attribute-err-load-rand
python - PIP or PIP3 broken. AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings' - Stack Overflow
August 21, 2022 - This error message appears when I attempt to install something using pip or pip3. I tried numerous approaches to fix the problem, but none were successful. Using PIP Traceback (most recent call las...
🌐
Frappe
discuss.frappe.io › install / update
ERPNext easy-install fails: AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings' - Install / Update - Frappe Forum
September 30, 2021 - Within the last 24 hours I have been attempting to use easy-install (on a fresh install of Debian 10). A similar install was completed successfully a few weeks ago. But now the script fails this error: AttributeError: module ‘lib’ has no attribute ‘ERR_load_RAND_strings’ Also, shortly before this error began to appear some previous attempts to run the easy-install script were failing at the stage of installing the erpnext app, with the error: Could not find app “erpnext” The erpnext ap...
Discussions

AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings'
Original exception was: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/... More on github.com
🌐 github.com
0
March 24, 2023
installation error
When I ran pipenv install django-tenants I received the following error: File "/Users/mainuser/anaconda/lib/python3.6/site-packages/OpenSSL/rand.py", line 213, in _lib.ERR_load_RAND_strin... More on github.com
🌐 github.com
4
October 30, 2021
Error installing Django package django-tenants - Stack Overflow
When attempting to install django-tenants via "pipenv install django-tenants" I get the following error: _lib.ERR_load_RAND_strings() AttributeError: module 'lib' has no attribute ' More on stackoverflow.com
🌐 stackoverflow.com
python - random.randint error: "AttributeError: 'module' object has no attribute 'randint'" - Stack Overflow
I have some code that looks something like this: import random n = 0 while n More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › ninemoreminutes › django-crum › issues › 33
AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings' · Issue #33 · ninemoreminutes/django-crum
March 24, 2023 - Original exception was: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/...
Author   glo45343
🌐
GitHub
github.com › django-tenants › django-tenants › issues › 680
installation error · Issue #680 · django-tenants/django-tenants
October 30, 2021 - When I ran pipenv install django-tenants I received the following error: File "/Users/mainuser/anaconda/lib/python3.6/site-packages/OpenSSL/rand.py", line 213, in _lib.ERR_load_RAND_strin...
Author   macumhail
🌐
Stack Overflow
stackoverflow.com › questions › 69816532 › error-installing-django-package-django-tenants
Error installing Django package django-tenants - Stack Overflow
When attempting to install django-tenants via "pipenv install django-tenants" I get the following error: _lib.ERR_load_RAND_strings() AttributeError: module 'lib' has no attribute '
🌐
GitHub
github.com › EmpireProject › Empire › issues › 697
AttributeError: 'module' object has no attribute 'rand' · Issue #697 · EmpireProject/Empire
September 14, 2017 - Traceback` (most recent call last): File "./empire", line 11, in <module> from lib.common import empire File "/opt/Empire/lib/common/empire.py", line 27, in <module> import agents File "/opt/Empire/lib/common/agents.py", line 68, in <module> import encryption File "/opt/Empire/lib/common/encryption.py", line 62, in <module> random_function = OpenSSL.rand.bytes AttributeError: 'module' object has no attribute 'rand'
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › attributeerror: module 'random' has no attribute 'randit'
r/learnpython on Reddit: AttributeError: module 'random' has no attribute 'randit'
January 12, 2024 - So, I keep this getting this error when I type in the following: ... Now, I have been told ( and also I have read elsewhere) that I have a file name with the name random attached to it and I should either remove it or rename it. The only file I have that is labeled random is a file labeled 'random' contained within the 'Python > Lib' section of my files.
🌐
GitHub
github.com › pyca › cryptography › issues › 9543
AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms' · Issue #9543 · pyca/cryptography
September 5, 2023 - (...) 3277 # OpenSSL library (and is linked against the same one that cryptography is 3278 # using)). -> 3279 _lib.OpenSSL_add_all_algorithms() 3281 # This is similar but exercised mainly by exception_from_error_queue. It calls 3282 # both ERR_load_crypto_strings() and ERR_load_SSL_strings(). 3283 _lib.SSL_load_error_strings() AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'
Author   danielstankw
🌐
GitHub
github.com › certbot › certbot › issues › 5111
AttibuteError: 'module' object has no attribute 'rand' has occured at acme/acme/crypto_util.py with >=pyOpenSSL-17.2.0 · Issue #5111 · certbot/certbot
September 14, 2017 - AttibuteError: 'module' object has no attribute 'rand' has occured at acme/acme/crypto_util.py with >=pyOpenSSL-17.2.0#5111 ... Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator standalone, Installer None Cert is due for renewal, auto-renewing... Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for domain.com Cleaning up challenges An unexpected error occurred: AttributeError: 'module' object has no attribute 'rand' Please see the logfiles in /var/log/letsencrypt for more details.
Author   darkcircle
🌐
GitHub
github.com › conda › conda › issues › 13619
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'? · Issue #13619 · conda/conda
February 22, 2024 - AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'?#13619
Author   eklavya-eg
🌐
Reddit
reddit.com › r/learnpython › 'module' object has no attribute 'randint' help
r/learnpython on Reddit: 'module' object has no attribute 'randint' HELP
September 19, 2018 -

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?