<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.brandon-rodriguez.com/index.php?action=history&amp;feed=atom&amp;title=Programming%2FPython%2FSetup</id>
	<title>Programming/Python/Setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.brandon-rodriguez.com/index.php?action=history&amp;feed=atom&amp;title=Programming%2FPython%2FSetup"/>
	<link rel="alternate" type="text/html" href="https://wiki.brandon-rodriguez.com/index.php?title=Programming/Python/Setup&amp;action=history"/>
	<updated>2026-05-07T13:38:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.brandon-rodriguez.com/index.php?title=Programming/Python/Setup&amp;diff=480&amp;oldid=prev</id>
		<title>Brodriguez: Brodriguez moved page Python/Setup to Programming/Python/Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.brandon-rodriguez.com/index.php?title=Programming/Python/Setup&amp;diff=480&amp;oldid=prev"/>
		<updated>2020-10-31T06:21:05Z</updated>

		<summary type="html">&lt;p&gt;Brodriguez moved page &lt;a href=&quot;/Python/Setup&quot; class=&quot;mw-redirect&quot; title=&quot;Python/Setup&quot;&gt;Python/Setup&lt;/a&gt; to &lt;a href=&quot;/Programming/Python/Setup&quot; title=&quot;Programming/Python/Setup&quot;&gt;Programming/Python/Setup&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:21, 31 October 2020&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key dev_wiki:diff::1.12:old-477:rev-480 --&gt;
&lt;/table&gt;</summary>
		<author><name>Brodriguez</name></author>
	</entry>
	<entry>
		<id>https://wiki.brandon-rodriguez.com/index.php?title=Programming/Python/Setup&amp;diff=477&amp;oldid=prev</id>
		<title>Brodriguez: Create page</title>
		<link rel="alternate" type="text/html" href="https://wiki.brandon-rodriguez.com/index.php?title=Programming/Python/Setup&amp;diff=477&amp;oldid=prev"/>
		<updated>2020-10-31T06:14:54Z</updated>

		<summary type="html">&lt;p&gt;Create page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual Environments ==&lt;br /&gt;
In Python, {{ ic |Virtual Environments}} are a way to separate Python package installations, in order to prevent conflicts between different project setups.&lt;br /&gt;
&lt;br /&gt;
=== Environment Setup ===&lt;br /&gt;
As of 2020, there are two recommended ways to setup Virtual Environments.&lt;br /&gt;
&lt;br /&gt;
==== Venv ====&lt;br /&gt;
The {{ ic |venv}} package is shipped with Python3 on windows. It also ships with some Python3 distributions on Linux systems.&lt;br /&gt;
&lt;br /&gt;
{{ ToDo | link to above for install? }}&lt;br /&gt;
&lt;br /&gt;
To create a new environment, use:&lt;br /&gt;
 python&amp;lt;version&amp;gt; -m venv &amp;lt;path_to_create_environment_at&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted a Python3.5 environment called &amp;#039;&amp;#039;&amp;#039;MyEnv&amp;#039;&amp;#039;&amp;#039; in your local user home directory, then use:&lt;br /&gt;
 python3.5 -m venv ~/MyEnv&lt;br /&gt;
&lt;br /&gt;
==== Virtualenv ====&lt;br /&gt;
Virtualenv is a third party package that&amp;#039;s officially supported by the PyPA (Python Packaging Authority).&lt;br /&gt;
&lt;br /&gt;
First, install with:&lt;br /&gt;
 pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
To createa new environment, use:&lt;br /&gt;
 virtualenv --python=python&amp;lt;version&amp;gt; &amp;lt;path_to_create_environment_at&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted a Python3.5 environment called &amp;#039;&amp;#039;&amp;#039;MyEnv&amp;#039;&amp;#039;&amp;#039; in your local user home directory, then use:&lt;br /&gt;
 virtualenv --python=3.5 ~/MyEnv&lt;br /&gt;
&lt;br /&gt;
=== Using Virtual Environments ===&lt;br /&gt;
Regardless of which above method you used to install the environment, you load them the same way.&lt;br /&gt;
&lt;br /&gt;
{{ note | In most OS&amp;#039;s, it display in console on every line, when a Python environment is loaded. You can further verify an environment has loaded via the {{ ic |which python}}, {{ ic |which pip}}, {{ ic |python -V}}, and {{ ic |pip -V}} commands.}}&lt;br /&gt;
&lt;br /&gt;
==== Linux/Mac ====&lt;br /&gt;
To load an environment, use:&lt;br /&gt;
 source &amp;lt;path_to_environment&amp;gt;/bin/activate&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 source ./my_env/bin/activate&lt;br /&gt;
&lt;br /&gt;
To unload an environment, use:&lt;br /&gt;
 deactivate&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
To load an environment, use:&lt;br /&gt;
 . &amp;lt;path_to_environment&amp;gt;/Scripts/activate&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 . &amp;lt;path_to_environment&amp;gt;/Scripts/activate&lt;br /&gt;
&lt;br /&gt;
=== Organizing Virtual Environments ===&lt;br /&gt;
There are two general practices for organizing Virtual Environments. Generally speaking, most prefer the first option, which creates a new environment for each project.&lt;br /&gt;
&lt;br /&gt;
==== An Environment for Each Project ====&lt;br /&gt;
This method involves creating an environment (usually labeled {{ ic |.venv}}) at the root of every project.&lt;br /&gt;
&lt;br /&gt;
This keeps all of your dependencies isolated for every project, which is particularly useful for mimicking and testing production setups.&lt;br /&gt;
&lt;br /&gt;
Furthermore, it&amp;#039;s possible to set up your console to automatically load these environments on directory change. See https://git.brandon-rodriguez.com/python/example_projects/virtual_environments.&lt;br /&gt;
&lt;br /&gt;
==== Multiple Environments in a Central Location ====&lt;br /&gt;
This method involves creating all your virtual environments in a single location (for example, {{ ic |~/Env/}}).&lt;br /&gt;
&lt;br /&gt;
For example, you might have {{ ic |~/Env/Django2.0}}, {{ ic |~/Env/wxPython}}, and {{ ic |~/Env/Django3.0}}.&lt;br /&gt;
&lt;br /&gt;
The benefit of this method is that you can reuse the same environment for multiple different projects, which results in less time setting up and maintaining environments.&lt;br /&gt;
&lt;br /&gt;
However, you might get package conflicts between projects. Furthermore, there is no way to have the console to automatically import your desired environment. You&amp;#039;ll have to manually select it with the above commands. {{ todo | link to commands }}&lt;/div&gt;</summary>
		<author><name>Brodriguez</name></author>
	</entry>
</feed>