문서 보기이전 판역링크맨 위로 이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요. {{tag>[python venv pip]}} ====== venv (Virtual ENViroment) ====== ===== Installation ====== - python2: virtualenv 패키지 설치 ''python -m install virtualenv'' - python3: 내장 ===== Usages ===== <code bash> python -m venv python -m venv .venv # Initalize to '.venv' </code> * ''<color #c3c3c3>**python -m venv**</color> <color #22b14c>[<switches>...]</color> <color #7092be>ENV_DIR</color>'' ++++ python -m venv help | <code text> usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps] ENV_DIR [ENV_DIR ...] Creates virtual Python environments in one or more target directories. positional arguments: ENV_DIR A directory to create the environment in. options: -h, --help show this help message and exit --system-site-packages Give the virtual environment access to the system site-packages dir. --symlinks Try to use symlinks rather than copies, when symlinks are not the default for the platform. --copies Try to use copies rather than symlinks, even when symlinks are the default for the platform. --clear Delete the contents of the environment directory if it already exists, before environment creation. --upgrade Upgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place. --without-pip Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default) --prompt PROMPT Provides an alternative prompt prefix for this environment. --upgrade-deps Upgrade core dependencies (pip) to the latest version in PyPI Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory. </code> ++++ ==== Initialize venv ==== * ''<color #c3c3c3>python3 -m</color> <color #ff7f27>venv</color> <color #7092be>.venv</color>'' ==== Activate venv ==== * ''<color #ff7f27>**source**</color> <color #7092be>.venv/bin/activate</color>'' * ''<color #ff7f27>**.**</color> <color #7092be>.venv/bin/activate</color>'' ==== Deactivate venv ==== * ''<color #ff7f27>**deactivate**</color>'' ==== TIP ==== * ''<color #c3c3c3>python3 -m</color> <color #ff7f27>venv</color> <color #7092be>.venv</color>'' .venv 경로에 설정(일반적) * ''<color #c3c3c3>pip</color> <color #ff7f27>install</color> <color #7092be>{packages...}</color>'' <color #7092be>package</color>설치 /home/u613600155/domains/cli.zerotymer.net/public_html/data/pages/python/venv.txt 마지막으로 수정됨: 2024/08/05 04:06저자 writer