{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# virtualenvwrapper" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- virtualenv는 많은 사람들이 사용하고 있을텐데, 매번 해당 폴더에 들어가서 source env/bin/activate 해야되는데 그 경로를 기억하기 어려운 경우가 존재\n", "- 이럴 경우 virtualenvwrapper를 사용하면 편함!\n", "~~~\n", "pip install virtualenvwrapper\n", "cd ~\n", "mkdir ~/.virtualenvs\n", "~~~" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "그 후, .bashrc / .zshrc에 아래 코드를 입력\n", "~~~\n", "vi ~/.bashrc\n", "or\n", "vi ~/.zshrc\n", "\n", "\n", "export WORKON_HOME=~/.virtualenvs\n", "export VIRTUALENVWRAPPER_PYTHON='$(python3 혹은 python 경로)' \n", "source /usr/local/bin/virtualenvwrapper.sh\n", "~~~\n", "- python3 혹은 python 경로는 which python3 / python (또는 python2)를 입력해서 나온 곳을 넣어주면 된다\n", "- virtualenvwrapper.sh 경로로 에러가 난다면 which virtualenvwrapper.sh로 경로 찾은 후 넣어두면 된다" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 명령어\n", "### 가상환경 만들기\n", "~~~\n", "mkvirtualenv 가상환경이름\n", "~~~" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 가상환경 지우기\n", "~~~\n", "rmvirtualenv 가상환경이름\n", "~~~\n", "\n", "### 가상환경 복사하기\n", "~~~\n", "cpvirtualenv old환경이름 new환경이름\n", "~~~\n", "\n", "### 가상환경 진입\n", "~~~\n", "workon 가상환경이름\n", "~~~\n", "\n", "### 가상환경 빠져나오기\n", "~~~\n", "deactivate\n", "~~~\n", "\n", "- 가상환경 이름을 바꾸고 싶다면, cp(복사) 후, 기존의 것을 rm하는 방식을 사용하면 편함" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.3" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }