{"id":259,"date":"2018-11-04T12:42:40","date_gmt":"2018-11-04T12:42:40","guid":{"rendered":"https:\/\/learnscripting.org\/?p=259"},"modified":"2018-11-04T12:42:40","modified_gmt":"2018-11-04T12:42:40","slug":"creating-virtual-environment-in-python-using-command-line-arguments","status":"publish","type":"post","link":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/","title":{"rendered":"Creating Virtual Environment in Python using Command Line Arguments"},"content":{"rendered":"<div class=\"documentwrapper\">\n<div class=\"bodywrapper\">\n<div class=\"body\" role=\"main\">\n<div id=\"installing-packages-using-pip-and-virtualenv\" class=\"section\">\n<h1>Installing packages using pip In virtualenv<\/h1>\n<p>This guide discusses how to install packages using <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/key_projects\/#pip\"><span class=\"std std-ref\">pip<\/span><\/a> and <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/key_projects\/#virtualenv\"><span class=\"std std-ref\">virtualenv<\/span><\/a>. These are the lowest-level tools for managing Python packages and are recommended if higher-level tools do not suit your needs.<\/p>\n<div class=\"admonition note\">\n<p class=\"first admonition-title\">Note<\/p>\n<p class=\"last\">This doc uses the term <strong>package<\/strong> to refer to a <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-distribution-package\"><span class=\"xref std std-term\">Distribution Package<\/span><\/a> which is different from a <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-import-package\"><span class=\"xref std std-term\">Import Package<\/span><\/a> that which is used to import modules in your Python source code.<\/p>\n<\/div>\n<div id=\"installing-pip\" class=\"section\">\n<h2>Installing pip<\/h2>\n<p><a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/key_projects\/#pip\"><span class=\"std std-ref\">pip<\/span><\/a> is the reference Python package manager. It\u2019s used to install and update packages. You\u2019ll need to make sure you have the latest version of pip installed.<\/p>\n<div id=\"windows\" class=\"section\">\n<h3>Windows<\/h3>\n<p>The Python installers for Windows include pip. You should be able to access pip using:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>py -m pip --version\npip <span class=\"m\">9<\/span>.0.1 from c:<span class=\"se\">\\p<\/span>ython36<span class=\"se\">\\l<\/span>ib<span class=\"se\">\\s<\/span>ite-packages <span class=\"o\">(<\/span>Python <span class=\"m\">3<\/span>.6.1<span class=\"o\">)<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<p>You can make sure that pip is up-to-date by running:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>py -m pip install --upgrade pip\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"linux-and-macos\" class=\"section\">\n<h3>Linux and macOS<\/h3>\n<p>Debian and most other distributions include a <a class=\"reference external\" href=\"https:\/\/packages.debian.org\/stable\/python-pip\">python-pip<\/a> package, if you want to use the Linux distribution-provided versions of pip see <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/guides\/installing-using-linux-tools\/\"><span class=\"doc\">Installing pip\/setuptools\/wheel with Linux Package Managers<\/span><\/a>.<\/p>\n<p>You can also install pip yourself to ensure you have the latest version. It\u2019s recommended to use the system pip to bootstrap a user installation of pip:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>python3 -m pip install --user --upgrade pip\n<\/pre>\n<\/div>\n<\/div>\n<p>Afterwards, you should have the newest pip installed in your user site:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>python3 -m pip --version\npip <span class=\"m\">9<\/span>.0.1 from <span class=\"nv\">$HOME<\/span>\/.local\/lib\/python3.6\/site-packages <span class=\"o\">(<\/span>python <span class=\"m\">3<\/span>.6<span class=\"o\">)<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"installing-virtualenv\" class=\"section\">\n<h2>Installing virtualenv<\/h2>\n<p><a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/key_projects\/#virtualenv\"><span class=\"std std-ref\">virtualenv<\/span><\/a> is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip.<\/p>\n<p>On macOS and Linux:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>python3 -m pip install --user virtualenv\n<\/pre>\n<\/div>\n<\/div>\n<p>On Windows:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>py -m pip install --user virtualenv\n<\/pre>\n<\/div>\n<\/div>\n<div class=\"admonition note\">\n<p class=\"first admonition-title\">Note<\/p>\n<p class=\"last\">If you are using Python 3.3 or newer the <a class=\"reference external\" title=\"(in Python v3.6)\" href=\"https:\/\/docs.python.org\/3.6\/library\/venv.html#module-venv\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">venv<\/span><\/code><\/a> module is included in the Python standard library. This can also create and manage virtual environments, however, it only supports Python 3.<\/p>\n<\/div>\n<\/div>\n<div id=\"creating-a-virtualenv\" class=\"section\">\n<h2>Creating a virtualenv<\/h2>\n<p><a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/key_projects\/#virtualenv\"><span class=\"std std-ref\">virtualenv<\/span><\/a> allows you to manage separate package installations for different projects. It essentially allows you to create a \u201cvirtual\u201d isolated Python installation and install packages into that virtual installation. When you switch projects, you can simply create a new virtual environment and not have to worry about breaking the packages installed in the other environments. It is always recommended to use a virtualenv while developing Python applications.<\/p>\n<p>To create a virtual environment, go to your project\u2019s directory and run virtualenv.<\/p>\n<p>On macOS and Linux:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>python3 -m virtualenv env\n<\/pre>\n<\/div>\n<\/div>\n<p>On Windows:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>py -m virtualenv env\n<\/pre>\n<\/div>\n<\/div>\n<p>The second argument is the location to create the virtualenv. Generally, you can just create this in your project and call it <code class=\"docutils literal notranslate\"><span class=\"pre\">env<\/span><\/code>.<\/p>\n<p>virtualenv will create a virtual Python installation in the <code class=\"docutils literal notranslate\"><span class=\"pre\">env<\/span><\/code> folder.<\/p>\n<div class=\"admonition note\">\n<p class=\"first admonition-title\">Note<\/p>\n<p class=\"last\">You should exclude your virtualenv directory from your version control system using <code class=\"docutils literal notranslate\"><span class=\"pre\">.gitignore<\/span><\/code> or similar.<\/p>\n<\/div>\n<\/div>\n<div id=\"activating-a-virtualenv\" class=\"section\">\n<h2>Activating a virtualenv<\/h2>\n<p>Before you can start installing or using packages in your virtualenv you\u2019ll need to <em>activate<\/em> it. Activating a virtualenv will put the virtualenv-specific <code class=\"docutils literal notranslate\"><span class=\"pre\">python<\/span><\/code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">pip<\/span><\/code> executables into your shell\u2019s <code class=\"docutils literal notranslate\"><span class=\"pre\">PATH<\/span><\/code>.<\/p>\n<p>On macOS and Linux:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre><span class=\"nb\">source<\/span> env\/bin\/activate\n<\/pre>\n<\/div>\n<\/div>\n<p>On Windows:<\/p>\n<div class=\"highlight-default notranslate\">\n<div class=\"highlight\">\n<pre><strong><span class=\"o\">.<\/span>\\<span class=\"n\">env<\/span>\\<span class=\"n\">Scripts<\/span>\\<span class=\"n\">activate<\/span>\n<\/strong><\/pre>\n<\/div>\n<\/div>\n<p>You can confirm you\u2019re in the virtualenv by checking the location of your Python interpreter, it should point to the <code class=\"docutils literal notranslate\"><span class=\"pre\">env<\/span><\/code> directory.<\/p>\n<p>On macOS and Linux:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>which python\n...\/env\/bin\/python\n<\/pre>\n<\/div>\n<\/div>\n<p>On Windows:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>where python\n...\/env\/bin\/python.exe\n<\/pre>\n<\/div>\n<\/div>\n<p>As long as your virtualenv is activated pip will install packages into that specific environment and you\u2019ll be able to import and use packages in your Python application.<\/p>\n<\/div>\n<div id=\"leaving-the-virtualenv\" class=\"section\">\n<h2>Leaving the virtualenv<\/h2>\n<p>If you want to switch projects or otherwise leave your virtualenv, simply run:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>deactivate\n<\/pre>\n<\/div>\n<\/div>\n<p>If you want to re-enter the virtualenv just follow the same instructions above about activating a virtualenv. There\u2019s no need to re-create the virtualenv.<\/p>\n<\/div>\n<div id=\"installing-packages\" class=\"section\">\n<h2>Installing packages<\/h2>\n<p>Now that you\u2019re in your virtualenv you can install packages. Let\u2019s install the excellent <a class=\"reference external\" href=\"http:\/\/docs.python-requests.org\/\">Requests<\/a> library from the <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-python-package-index-pypi\"><span class=\"xref std std-term\">Python Package Index (PyPI)<\/span><\/a>:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install requests\n<\/pre>\n<\/div>\n<\/div>\n<p>pip should download requests and all of its dependencies and install them:<\/p>\n<div class=\"highlight-text notranslate\">\n<div class=\"highlight\">\n<pre>Collecting requests\n  Using cached requests-2.18.4-py2.py3-none-any.whl\nCollecting chardet&lt;3.1.0,&gt;=3.0.2 (from requests)\n  Using cached chardet-3.0.4-py2.py3-none-any.whl\nCollecting urllib3&lt;1.23,&gt;=1.21.1 (from requests)\n  Using cached urllib3-1.22-py2.py3-none-any.whl\nCollecting certifi&gt;=2017.4.17 (from requests)\n  Using cached certifi-2017.7.27.1-py2.py3-none-any.whl\nCollecting idna&lt;2.7,&gt;=2.5 (from requests)\n  Using cached idna-2.6-py2.py3-none-any.whl\nInstalling collected packages: chardet, urllib3, certifi, idna, requests\nSuccessfully installed certifi-2017.7.27.1 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"installing-specific-versions\" class=\"section\">\n<h2>Installing specific versions<\/h2>\n<p>pip allows you to specify which version of a package to install using <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-version-specifier\"><span class=\"xref std std-term\">version specifiers<\/span><\/a>. For example, to install a specific version of <code class=\"docutils literal notranslate\"><span class=\"pre\">requests<\/span><\/code>:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install <span class=\"nv\">requests<\/span><span class=\"o\">==<\/span><span class=\"m\">2<\/span>.18.4\n<\/pre>\n<\/div>\n<\/div>\n<p>To install the latest <code class=\"docutils literal notranslate\"><span class=\"pre\">2.x<\/span><\/code> release of requests:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install requests&gt;<span class=\"o\">=<\/span><span class=\"m\">2<\/span>.0.0,&lt;<span class=\"m\">3<\/span>.0.0\n<\/pre>\n<\/div>\n<\/div>\n<p>To install pre-release versions of packages, use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--pre<\/span><\/code> flag:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install --pre requests\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"installing-extras\" class=\"section\">\n<h2>Installing extras<\/h2>\n<p>Some packages have optional <a class=\"reference external\" href=\"https:\/\/setuptools.readthedocs.io\/en\/latest\/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies\">extras<\/a>. You can tell pip to install these by specifying the extra in brackets:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install requests<span class=\"o\">[<\/span>security<span class=\"o\">]<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"installing-from-source\" class=\"section\">\n<h2>Installing from source<\/h2>\n<p>pip can install a package directly from source, for example:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre><span class=\"nb\">cd<\/span> google-auth\npip install .\n<\/pre>\n<\/div>\n<\/div>\n<p>Additionally, pip can install packages from source in <a class=\"reference external\" href=\"https:\/\/setuptools.readthedocs.io\/en\/latest\/setuptools.html#development-mode\">development mode<\/a>, meaning that changes to the source directory will immediately affect the installed package without needing to re-install:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install --editable .\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"installing-from-version-control-systems\" class=\"section\">\n<h2>Installing from version control systems<\/h2>\n<p>pip can install packages directly from their version control system. For example, you can install directly from a git repository:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>git+https:\/\/github.com\/GoogleCloudPlatform\/google-auth-library-python.git#egg<span class=\"o\">=<\/span>google-auth\n<\/pre>\n<\/div>\n<\/div>\n<p>For more information on supported version control systems and syntax, see pip\u2019s documentation on <a class=\"reference external\" title=\"(in pip v18.1)\" href=\"https:\/\/pip.pypa.io\/en\/latest\/reference\/pip_install\/#vcs-support\"><span class=\"xref std std-ref\">VCS Support<\/span><\/a>.<\/p>\n<\/div>\n<div id=\"installing-from-local-archives\" class=\"section\">\n<h2>Installing from local archives<\/h2>\n<p>If you have a local copy of a <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-distribution-package\"><span class=\"xref std std-term\">Distribution Package<\/span><\/a>\u2019s archive (a zip, wheel, or tar file) you can install it directly with pip:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install requests-2.18.4.tar.gz\n<\/pre>\n<\/div>\n<\/div>\n<p>If you have a directory containing archives of multiple packages, you can tell pip to look for packages there and not to use the <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-python-package-index-pypi\"><span class=\"xref std std-term\">Python Package Index (PyPI)<\/span><\/a> at all:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install --no-index --find-links<span class=\"o\">=<\/span>\/local\/dir\/ requests\n<\/pre>\n<\/div>\n<\/div>\n<p>This is useful if you are installing packages on a system with limited connectivity or if you want to strictly control the origin of distribution packages.<\/p>\n<\/div>\n<div id=\"using-other-package-indexes\" class=\"section\">\n<h2>Using other package indexes<\/h2>\n<p>If you want to download packages from a different index than the <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-python-package-index-pypi\"><span class=\"xref std std-term\">Python Package Index (PyPI)<\/span><\/a>, you can use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--index-url<\/span><\/code> flag:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install --index-url http:\/\/index.example.com\/simple\/ SomeProject\n<\/pre>\n<\/div>\n<\/div>\n<p>If you want to allow packages from both the <a class=\"reference internal\" href=\"https:\/\/packaging.python.org\/glossary\/#term-python-package-index-pypi\"><span class=\"xref std std-term\">Python Package Index (PyPI)<\/span><\/a> and a separate index, you can use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--extra-index-url<\/span><\/code> flag instead:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install --extra-index-url http:\/\/index.example.com\/simple\/ SomeProject\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"upgrading-packages\" class=\"section\">\n<h2>Upgrading packages<\/h2>\n<p>pip can upgrade packages in-place using the <code class=\"docutils literal notranslate\"><span class=\"pre\">--upgrade<\/span><\/code> flag. For example, to install the latest version of <code class=\"docutils literal notranslate\"><span class=\"pre\">requests<\/span><\/code> and all of its dependencies:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install --upgrade requests\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"using-requirements-files\" class=\"section\">\n<h2>Using requirements files<\/h2>\n<p>Instead of installing packages individually, pip allows you to declare all dependencies in a <a class=\"reference external\" title=\"(in pip v18.1)\" href=\"https:\/\/pip.pypa.io\/en\/latest\/user_guide\/#requirements-files\"><span class=\"xref std std-ref\">Requirements File<\/span><\/a>. For example you could create a <code class=\"file docutils literal notranslate\"><span class=\"pre\">requirements.txt<\/span><\/code> file containing:<\/p>\n<div class=\"highlight-text notranslate\">\n<div class=\"highlight\">\n<pre>requests==2.18.4\ngoogle-auth==1.1.0\n<\/pre>\n<\/div>\n<\/div>\n<p>And tell pip to install all of the packages in this file using the <code class=\"docutils literal notranslate\"><span class=\"pre\">-r<\/span><\/code> flag:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip install -r requirements.txt\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"freezing-dependencies\" class=\"section\">\n<h2>Freezing dependencies<\/h2>\n<p>Pip can export a list of all installed packages and their versions using the <code class=\"docutils literal notranslate\"><span class=\"pre\">freeze<\/span><\/code> command:<\/p>\n<div class=\"highlight-bash notranslate\">\n<div class=\"highlight\">\n<pre>pip freeze\n<\/pre>\n<\/div>\n<\/div>\n<p>Which will output a list of package specifiers such as:<\/p>\n<div class=\"highlight-text notranslate\">\n<div class=\"highlight\">\n<pre>cachetools==2.0.1\ncertifi==2017.7.27.1\nchardet==3.0.4\ngoogle-auth==1.1.1\nidna==2.6\npyasn1==0.3.6\npyasn1-modules==0.1.4\nrequests==2.18.4\nrsa==3.4.2\nsix==1.11.0\nurllib3==1.22\n<\/pre>\n<\/div>\n<\/div>\n<p>This is useful for creating <a class=\"reference external\" title=\"(in pip v18.1)\" href=\"https:\/\/pip.pypa.io\/en\/latest\/user_guide\/#requirements-files\">Requirements Files<\/a> that can re-create the exact versions of all packages installed in an environment.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Installing packages using pip In virtualenv This guide discusses how to install packages using pip and virtualenv. These are the lowest-level tools for managing Python packages and are recommended if higher-level tools do not suit your needs. Note This doc uses the term package to refer to a Distribution Package which is different from a &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"facebook_2613112545524186_272996453239123":"","twitter_aTo5NzY3MTIyNTIwMzEwNTM4MjQ7_976712252031053800":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[24],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating Virtual Environment in Python using Command Line Arguments - Learn Scripting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Virtual Environment in Python using Command Line Arguments - Learn Scripting\" \/>\n<meta property=\"og:description\" content=\"Installing packages using pip In virtualenv This guide discusses how to install packages using pip and virtualenv. These are the lowest-level tools for managing Python packages and are recommended if higher-level tools do not suit your needs. Note This doc uses the term package to refer to a Distribution Package which is different from a &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Scripting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/profile.php?id=100064270142636\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-04T12:42:40+00:00\" \/>\n<meta name=\"author\" content=\"Shakti Das\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shakti Das\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/\"},\"author\":{\"name\":\"Shakti Das\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#\\\/schema\\\/person\\\/71045e0c38b97ea7f76363d6effa320c\"},\"headline\":\"Creating Virtual Environment in Python using Command Line Arguments\",\"datePublished\":\"2018-11-04T12:42:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/\"},\"wordCount\":980,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#organization\"},\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/\",\"url\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/\",\"name\":\"Creating Virtual Environment in Python using Command Line Arguments - Learn Scripting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#website\"},\"datePublished\":\"2018-11-04T12:42:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/creating-virtual-environment-in-python-using-command-line-arguments\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/learnscripting.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating Virtual Environment in Python using Command Line Arguments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#website\",\"url\":\"https:\\\/\\\/learnscripting.org\\\/\",\"name\":\"Learn Scripting\",\"description\":\"Coding Knowledge Unveiled: Empower Yourself\",\"publisher\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/learnscripting.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#organization\",\"name\":\"Learn Scripting\",\"url\":\"https:\\\/\\\/learnscripting.org\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/learnscripting.org\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/cropped-ls-600x600-1-512x512.jpg?fit=512%2C512&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/learnscripting.org\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/cropped-ls-600x600-1-512x512.jpg?fit=512%2C512&ssl=1\",\"width\":512,\"height\":512,\"caption\":\"Learn Scripting\"},\"image\":{\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=100064270142636\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/learnscripting.org\\\/#\\\/schema\\\/person\\\/71045e0c38b97ea7f76363d6effa320c\",\"name\":\"Shakti Das\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5492ae25bd62294799695759ba85aaa28ae3d1de6b30be7cbdc377abc2ea0aac?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5492ae25bd62294799695759ba85aaa28ae3d1de6b30be7cbdc377abc2ea0aac?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5492ae25bd62294799695759ba85aaa28ae3d1de6b30be7cbdc377abc2ea0aac?s=96&d=mm&r=g\",\"caption\":\"Shakti Das\"},\"sameAs\":[\"https:\\\/\\\/learnscripting.org\"],\"url\":\"https:\\\/\\\/learnscripting.org\\\/author\\\/53kgl\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating Virtual Environment in Python using Command Line Arguments - Learn Scripting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/","og_locale":"en_US","og_type":"article","og_title":"Creating Virtual Environment in Python using Command Line Arguments - Learn Scripting","og_description":"Installing packages using pip In virtualenv This guide discusses how to install packages using pip and virtualenv. These are the lowest-level tools for managing Python packages and are recommended if higher-level tools do not suit your needs. Note This doc uses the term package to refer to a Distribution Package which is different from a &hellip;","og_url":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/","og_site_name":"Learn Scripting","article_publisher":"https:\/\/www.facebook.com\/profile.php?id=100064270142636","article_published_time":"2018-11-04T12:42:40+00:00","author":"Shakti Das","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Shakti Das","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/#article","isPartOf":{"@id":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/"},"author":{"name":"Shakti Das","@id":"https:\/\/learnscripting.org\/#\/schema\/person\/71045e0c38b97ea7f76363d6effa320c"},"headline":"Creating Virtual Environment in Python using Command Line Arguments","datePublished":"2018-11-04T12:42:40+00:00","mainEntityOfPage":{"@id":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/"},"wordCount":980,"commentCount":0,"publisher":{"@id":"https:\/\/learnscripting.org\/#organization"},"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/","url":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/","name":"Creating Virtual Environment in Python using Command Line Arguments - Learn Scripting","isPartOf":{"@id":"https:\/\/learnscripting.org\/#website"},"datePublished":"2018-11-04T12:42:40+00:00","breadcrumb":{"@id":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnscripting.org\/creating-virtual-environment-in-python-using-command-line-arguments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learnscripting.org\/"},{"@type":"ListItem","position":2,"name":"Creating Virtual Environment in Python using Command Line Arguments"}]},{"@type":"WebSite","@id":"https:\/\/learnscripting.org\/#website","url":"https:\/\/learnscripting.org\/","name":"Learn Scripting","description":"Coding Knowledge Unveiled: Empower Yourself","publisher":{"@id":"https:\/\/learnscripting.org\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnscripting.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/learnscripting.org\/#organization","name":"Learn Scripting","url":"https:\/\/learnscripting.org\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learnscripting.org\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/learnscripting.org\/wp-content\/uploads\/2022\/03\/cropped-ls-600x600-1-512x512.jpg?fit=512%2C512&ssl=1","contentUrl":"https:\/\/i0.wp.com\/learnscripting.org\/wp-content\/uploads\/2022\/03\/cropped-ls-600x600-1-512x512.jpg?fit=512%2C512&ssl=1","width":512,"height":512,"caption":"Learn Scripting"},"image":{"@id":"https:\/\/learnscripting.org\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/profile.php?id=100064270142636"]},{"@type":"Person","@id":"https:\/\/learnscripting.org\/#\/schema\/person\/71045e0c38b97ea7f76363d6effa320c","name":"Shakti Das","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5492ae25bd62294799695759ba85aaa28ae3d1de6b30be7cbdc377abc2ea0aac?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5492ae25bd62294799695759ba85aaa28ae3d1de6b30be7cbdc377abc2ea0aac?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5492ae25bd62294799695759ba85aaa28ae3d1de6b30be7cbdc377abc2ea0aac?s=96&d=mm&r=g","caption":"Shakti Das"},"sameAs":["https:\/\/learnscripting.org"],"url":"https:\/\/learnscripting.org\/author\/53kgl\/"}]}},"_links":{"self":[{"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":0,"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"wp:attachment":[{"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnscripting.org\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}