Issue
I'm trying to test how a package that I've created installs on a machine with a base Python 3 install, meaning no additional packages have been installed via pip, easy_install, etc.
How do I setup a virtual environment that acts like a clean install of Python 3? If I create a pipenv
or virtualenv
, then list all my installed packages, the 30 or so that I have are all still there. How can I make a Python environment that behaves like a brand new install of Python and has no extra packages?
This is in Raspberry Pi OS which has only one user, so using the --user
flag in pip install --user
might as well be a global install. I considered creating a new pipenv
then pip uninstall
ing everything, but am worried that will break something.
Thanks for your help.
Solution
With virtualenv you would do :
virtualenv myenv -p python3.8
This would create a virtual environment in the myenv directory with python3.8 and the standard library only. You would activate this by doing
source myenv/bin/activate.sh
If you are using virtualenvwrapper, then you create the virtual environment by doing:
mkvirtualenv myenv -p python3.8
and activate it by doing:
workon myenv
Answered By - Tony Suffolk 66 Answer Checked By - Timothy Miller (WPSolving Admin)