32👍
✅
You have to recreate your virtual environment.
My guess is that the following has happended:
- You created a virtualenv
- At some later point in time, the system’s Python installation was updated with the urandom security bugfix.
- Your virtualenv (created from a previous Python point release) does not work anymore (due to the issue you mention in your question)
The simplest fix is to delete your virtual environment and create a new one:
$ rm -r VIRTUALENVDIR
$ virtualenv VIRTUALENVDIR
$ . VIRTUALENVDIR/bin/activate
# then pip install any required packages, if your project has a requirements.txt file,
# this is simply:
$ pip install -r requirements.txt
# otherwise, you will have to install each package
$ pip install packagename
$ pip install packagename==version
Source:stackexchange.com