<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ajay</title>
    <description>The latest articles on DEV Community by ajay (@uajay).</description>
    <link>https://dev.to/uajay</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1118282%2F5f804613-ffbe-46c0-8ee1-e5864704efa7.JPG</url>
      <title>DEV Community: ajay</title>
      <link>https://dev.to/uajay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/uajay"/>
    <language>en</language>
    <item>
      <title>Linux having multi-python virtual environment too ...</title>
      <dc:creator>ajay</dc:creator>
      <pubDate>Sat, 02 Nov 2024 17:53:38 +0000</pubDate>
      <link>https://dev.to/uajay/linux-having-multi-python-virtual-environment-too--3526</link>
      <guid>https://dev.to/uajay/linux-having-multi-python-virtual-environment-too--3526</guid>
      <description>&lt;p&gt;By setting up the &lt;strong&gt;python2&lt;/strong&gt;/&lt;strong&gt;python3&lt;/strong&gt;: &lt;code&gt;pip package manager&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I'd install the virtualenv-wrapper package, then create virtual environment in python3.&lt;/p&gt;

&lt;p&gt;It was working on &lt;em&gt;Windows&lt;/em&gt; only, but now &lt;strong&gt;Linux&lt;/strong&gt; too, just adding some bash script in the ".bashrc" file in the Linux system.&lt;/p&gt;

&lt;p&gt;For quick setup - install python and pip3, if I haven't installed or checking at least by &lt;code&gt;which&lt;/code&gt; command in Linux (Arch, Debian, Fedora or ubuntu ) for my PC.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;python3-pip&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;python3-virtualenvwrapper&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nano&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;~/.bashrc&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By adding these scripts by scrolling below at the end of the ".bashrc" file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3.x'&lt;br&gt;
export WORK_ON='/home/linux_name/python_environment'(.virtualenv folder)&lt;br&gt;
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;where,&lt;/p&gt;

&lt;p&gt;python3.x = python3.8, python3.9 or python2.10, etc.&lt;/p&gt;

&lt;p&gt;python_environment = any folder name in the home directory&lt;/p&gt;

&lt;p&gt;linux_name = computer name for Linux system, like in my case "hackout" is a name of Linux.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;upgrade&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if you want to know, then see this &lt;a href="https://youtu.be/tOPTt6nhCsM?feature=shared" rel="noopener noreferrer"&gt;demo video&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;finds some helpful commands.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lsvirtualenv&lt;/code&gt;&lt;br&gt;
List all of the environments stored in WORKON_HOME.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkvirtualenv &amp;lt;name&amp;gt;&lt;/code&gt;&lt;br&gt;
create the environment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rmvirtualenv &amp;lt;name&amp;gt;&lt;/code&gt;&lt;br&gt;
Remove the environment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;workon &amp;lt;name&amp;gt;&lt;/code&gt;&lt;br&gt;
If is specified, activate the environment named (change the working virtualenv to ). If a project directory has been defined, we will change it. If no argument is specified, list the available environments. One can pass additional option -c after virtualenv name to cd to virtualenv directory if no project dir is set.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;deactivate&lt;/code&gt;&lt;br&gt;
Deactivate the working virtualenv and switch back to the default system Python.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;add2virtualenv &amp;lt;full or relative path&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Yeah! I can do machine learning and deep learning projects, and most important make a remarkable website with Django or flask in a python virtual environment customized.&lt;/p&gt;

&lt;p&gt;Okay, here is a short note, about how I got this lazy idea and where I find it, then read the pypi.org sub-projects.&lt;/p&gt;

&lt;p&gt;Peace GUYS&lt;/p&gt;

&lt;p&gt;Happy Hacking !!&lt;/p&gt;

</description>
      <category>python3</category>
      <category>virtualenv</category>
    </item>
  </channel>
</rss>
