Last active
November 17, 2020 21:08
-
-
Save pyjavo/9a8fc8f8d2ce23d04cda to your computer and use it in GitHub Desktop.
VIRTUALENV: Comandos comunes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################### Linux y OS X ######################### | |
====================== Python3 ========================= | |
# Viene por defecto en python3 | |
# Para borrar, solo eliminas la carpeta que crea | |
python3 -m venv MYVENV | |
# Activando el ambiente virtual | |
source MYVENV/bin/activate | |
# Variables de entorno en virtual env | |
# usar django-environ | |
######################### UBUNTU ######################### | |
Crear proyecto de Django en un virtualenv (UBUNTU) | |
/home/javier/.virtualenvs/nombre-ambiente/local/bin/django-admin.py startproject NombreProyecto | |
en MacOS | |
/Users/mi-usuario/.virtualenvs/nombre-ambiente/bin/django-admin.py startproject NombreProyecto | |
Create a new virtualenv | |
mkvirtualenv myawesomeproject | |
To load or switch between virtualenvs, use the workon command: | |
workon myawesomeproject | |
Deactivate environment | |
deactivate | |
Remove environment | |
rmvirtualenv myawesomeproject | |
To create completely isolated environment from system wide site-packages | |
mkvirtualenv isolatedenv --no-site-packages | |
Create environment that uses system site-packages | |
mkvirtualenv firme --system-site-packages | |
###### Sin virtualenvwrapper ###### | |
CREAR | |
virtualenv NOMBRE_ENV | |
Activar | |
source NOMBRE_ENV/bin/activate | |
Correr el pip del ambiente virtual | |
myenv/bin/pip freeze | |
###################### WINDOWS ###################### | |
Crear proyecto sin virtualenvwrapper (WINDOWS) | |
virtualenv nombreenv | |
Activar environment sin virtualenvwrapper (WINDOWS) | |
nombreenv\Scripts\activate | |
Desactivar environment sin virtualenvwrapper (WINDOWS) | |
deactivate | |
Crear proyecto de Django en un virtualenv (WINDOWS) | |
python myenvironment\Scripts\django-admin.py startproject NombreProyecto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment