I assume you already installed python on windows and added it in your PATH
. for making a python virtual environment do these steps:
Step 1: Change Directory
open cmd
and write your UBS
assigned letter + :
to change the directory. assuming your USB
is mounted as D
volume.
C:UsersName>D:
D:>
Step 2: Creating Virtual Environment
D:>python -m venv otg
you can substitute otg
with any name you want.
Step 3: Activating Virtual Environment
D:>otgScriptsactivate.bat
now you are in the created virtual environment. the CMD
prompt must be sth like this
(otg) D:>
install whatever you want. to confirm that everything is Ok, the where python
command in cmd must return sth like this:
D:otgScriptspython.exe
Step 4: Exiting From Environment
after you finished your work you can exit the virtual environment by issuing this command
(otg) D:>deactivate
Now you can unplug your USB
and attach it to any other system. to access the python environment you just need to repeat steps 1
, 3
and 4
. for more information about virtual environments Python Docs is a good source.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…