I know that this error should be raised normally, but I am already working in a virtual environment, where the error should not be raised. I created and activated a virtual environment on my Raspberry Pi 4, so that I could install packages. It has been working fine. Seemingly randomly, I am getting the "This environment is externally managed..." error with the venv active. I disconnected the Internet connection and tried a pip install on the system Python installation, and that tried to work. The only thing I can think of as a possible cause was adding the activate command to the end of the .bashrc file, but it was running fine like this for weeks. How do I recover my virtual environment and restore the protections to the system Python installation? Continue reading...