mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 13:42:11 +01:00
Merge pull request #268 from pierrepo/master
Add options for pip and a new cheatsheet for virtualenv
This commit is contained in:
commit
7e5e4315e5
2 changed files with 44 additions and 0 deletions
|
@ -4,6 +4,12 @@ pip search SomePackage
|
|||
# Install some packages
|
||||
pip install SomePackage
|
||||
|
||||
# Install some package in user space
|
||||
pip install --user SomePackage
|
||||
|
||||
# Upgrade some package
|
||||
pip install --upgrade SomePackage
|
||||
|
||||
# Output and install packages in a requirement file
|
||||
pip freeze > requirements.txt
|
||||
pip install -r requirements.txt
|
||||
|
|
38
cheat/cheatsheets/virtualenv
Normal file
38
cheat/cheatsheets/virtualenv
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Create new environment
|
||||
virtualenv /path/to/project/env_name
|
||||
|
||||
# Create new environment and inherit already installed Python libraries
|
||||
virtualenv --system-site-package /path/to/project/env_name
|
||||
|
||||
# Create new environment with a given Python interpreter
|
||||
virtualenv /path/to/project/env_name -p /usr/bin/python/3.4
|
||||
|
||||
# Activate environnment
|
||||
source /path/to/project/env_name/bin/activate
|
||||
|
||||
# Quit environment
|
||||
deactivate
|
||||
|
||||
|
||||
# virtualenvwrapper (wrapper for virtualenv)
|
||||
# installation
|
||||
pip install --user virtualenvwrapper
|
||||
# configuration
|
||||
# add in ~/.bashrc or similar
|
||||
export WORKON_HOME=~/.virtualenvs
|
||||
mkdir -p $WORKON_HOME
|
||||
source ~/.local/bin/virtualenvwrapper.sh
|
||||
|
||||
# Create new environmment (with virtualenvwrapper)
|
||||
mkvirtualenv env_name
|
||||
# new environmment is stored in ~/.virtualenvs
|
||||
|
||||
# Activate environmment (with virtualenvwrapper)
|
||||
workon env_name
|
||||
|
||||
# Quit environmment (with virtualenvwrapper)
|
||||
deactivate
|
||||
|
||||
# Delete environmment (with virtualenvwrapper)
|
||||
rmvirtualenv env_name
|
||||
|
Loading…
Reference in a new issue