{"id":508,"date":"2016-12-12T12:48:32","date_gmt":"2016-12-12T12:48:32","guid":{"rendered":"http:\/\/blog.cloudxlab.com\/?p=508"},"modified":"2024-01-10T07:39:54","modified_gmt":"2024-01-10T07:39:54","slug":"install-python-packages-cloudxlab","status":"publish","type":"post","link":"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/","title":{"rendered":"Install Python packages on CloudxLab"},"content":{"rendered":"<p>In this blog post, we will learn how to install Python packages on CloudxLab.<\/p>\n<h3>Step 1-<\/h3>\n<p>Create the virtual environment for your project.\u00a0A virtual environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. <a href=\"https:\/\/www.youtube.com\/watch?v=fyOh7Afe2GM\">Login to CloudxLab web console<\/a> and create a virtual environment for your project.<\/p>\n<p>First of all, let&#8217;s switch to python3 using:-<\/p>\n<pre>export PATH=\/usr\/local\/anaconda\/bin:$PATH<\/pre>\n<p>Now let&#8217;s create a directory and the virtual environment inside it.<\/p>\n<pre class=\"lang:default decode:true\">$ mkdir my_project\n$ cd my_project\n$ python -m venv venv<\/pre>\n<p><!--more--><\/p>\n<h3><strong>Step 2-<\/strong><\/h3>\n<p>To begin using the virtual environment, it needs to be activated:<\/p>\n<pre class=\"lang:default decode:true\">$ . venv\/bin\/activate<\/pre>\n<p>Remember the dot &#8220;.&#8221; at the starting of the above command. The name of the current virtual environment will now appear on the left of the prompt (e.g. <code class=\"docutils literal\"><span class=\"pre\">(venv)[your_username@cxln4 ~]$:my_project<\/span><span class=\"pre\">$)<\/span><\/code> to let you know that it\u2019s active. From now on, any package that you install using pip will be placed in the <code class=\"docutils literal\"><span class=\"pre\">venv<\/span><\/code> folder.<\/p>\n<h3><strong>Step 3-\u00a0<\/strong><\/h3>\n<p>Install packages as usual<\/p>\n<pre class=\"lang:default decode:true\">$ pip install requests\n$ pip install flask<\/pre>\n<h2><strong>Step 4-<\/strong><\/h2>\n<p>If you are done working in the virtual environment you can deactivate it:<\/p>\n<pre class=\"lang:default decode:true\">$ deactivate<\/pre>\n<p>Next time when you want to use the same virtual environment, go to your project directory and activate the virtual environment<\/p>\n<pre class=\"lang:default decode:true \">$ cd my_project\n$ . venv\/bin\/activate<\/pre>\n\n\n<h2>Launching Jupyter Notebook inside your virtual environment<\/h2>\n\n\n\n<p>You can also launch jupyter notebook inside your virtual environment. For that, you need to follow the below steps:-<\/p>\n\n\n\n<h3>Step 1-<\/h3>\n\n\n\n<p>First of all, activate your virtual environment.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd my_project\n. venv\/bin\/activate<\/pre>\n\n\n\n<h3>Step 2-<\/h3>\n\n\n\n<p>Install jupyter notebook using the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install jupyter<\/pre>\n\n\n\n<h3>Step 3-<\/h3>\n\n\n\n<p>Add your virtual environment to the jupyter.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python -m ipykernel install --user --name=venv<\/pre>\n\n\n\n<h3>Step 4-<\/h3>\n\n\n\n<p>Now go to Jupyter Homepage at\u00a0<a href=\"https:\/\/jupyter.e.cloudxlab.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/jupyter.e.cloudxlab.com\/<\/a>. Click on &#8220;New&#8221;. There you will be able to see a kernel with the name of your virtual environment (venv). Launch notebook with that kernel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1326\" height=\"453\" src=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-10-at-1.01.23-PM.png\" alt=\"\" class=\"wp-image-4183\"\/><\/figure>\n\n\n\n<p>Now you can use jupyter notebook in your virtual environment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, we will learn how to install Python packages on CloudxLab. Step 1- Create the virtual environment for your project.\u00a0A virtual environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. Login to CloudxLab web console and create a virtual &hellip; <a href=\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install Python packages on CloudxLab&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Install Python packages on CloudxLab | CloudxLab Blog<\/title>\n<meta name=\"description\" content=\"In this blog post, we will learn how to install Python packages on CloudxLab using virtual environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Python packages on CloudxLab | CloudxLab Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog post, we will learn how to install Python packages on CloudxLab using virtual environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/\" \/>\n<meta property=\"og:site_name\" content=\"CloudxLab Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cloudxlab\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-12T12:48:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-10T07:39:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-10-at-1.01.23-PM.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CloudxLab\" \/>\n<meta name=\"twitter:site\" content=\"@CloudxLab\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/#website\",\"url\":\"https:\/\/cloudxlab.com\/blog\/\",\"name\":\"CloudxLab Blog\",\"description\":\"Learn AI, Machine Learning, Deep Learning, Devops &amp; Big Data\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/cloudxlab.com\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-10-at-1.01.23-PM.png\",\"contentUrl\":\"https:\/\/blog.cloudxlab.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-10-at-1.01.23-PM.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/#webpage\",\"url\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/\",\"name\":\"Install Python packages on CloudxLab | CloudxLab Blog\",\"isPartOf\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/#primaryimage\"},\"datePublished\":\"2016-12-12T12:48:32+00:00\",\"dateModified\":\"2024-01-10T07:39:54+00:00\",\"author\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/#\/schema\/person\/0efa3c54df68406de820ea466f002d3c\"},\"description\":\"In this blog post, we will learn how to install Python packages on CloudxLab using virtual environment.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/\",\"url\":\"https:\/\/cloudxlab.com\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@id\":\"https:\/\/cloudxlab.com\/blog\/install-python-packages-cloudxlab\/#webpage\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/#\/schema\/person\/0efa3c54df68406de820ea466f002d3c\",\"name\":\"Abhinav Singh\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/cloudxlab.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fc74fe31169bf872f6ab11bbab621d53?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fc74fe31169bf872f6ab11bbab621d53?s=96&d=mm&r=g\",\"caption\":\"Abhinav Singh\"},\"sameAs\":[\"https:\/\/cloudxlab.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts\/508"}],"collection":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/comments?post=508"}],"version-history":[{"count":15,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":4186,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/posts\/508\/revisions\/4186"}],"wp:attachment":[{"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/media?parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/categories?post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudxlab.com\/blog\/wp-json\/wp\/v2\/tags?post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}