<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Python &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Tue, 17 Aug 2021 07:08:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Python &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How Do I Upgrade my Python on CentOS 8</title>
		<link>https://help.hostry.com/knowledge-base/how-do-i-upgrade-my-python-on-centos-8/</link>
					<comments>https://help.hostry.com/knowledge-base/how-do-i-upgrade-my-python-on-centos-8/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Thu, 12 Aug 2021 07:22:34 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=4134</guid>

					<description><![CDATA[In order for you to perform this operation to update your Python version, you need to update your CentOS 8 and have root rights for your VPS Checking Your Python Version In order to go to upgrade your python, you need to check its version. This can be done using [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>In order for you to perform this operation to update your <strong>Python</strong> version, you need to update your CentOS 8 and have root rights for your VPS</p>



<h2 id="checking-your-python-version" >Checking Your Python Version</h2>



<p>In order to go to upgrade your python, you need to check its version. This can be done using the following command:</p>



<pre class="wp-block-code"><code>python3 -V</code></pre>



<p>If python is successfully installed on your server, then you should get something like this:</p>



<pre class="wp-block-code"><code>Python 3.6.7</code></pre>



<h2 id="updating-your-python-version" >Updating your Python Version</h2>



<p>First, you need to install the required dependencies to compile the Python source code. This can be done using a special command, which is presented below:</p>



<pre class="wp-block-code"><code>yum groupinstall 'development tools' -y &amp;&amp; yum install wget openssl-devel bzip2-devel libffi-devel xz-devel -y</code></pre>



<p>After that, we recommend going to the <strong><a href="https://www.python.org/downloads/source/">Python</a></strong> source download page to find the latest gzip version of the source code. Replace the urls and filenames in this tutorial with the latest version. Then download your <strong>python</strong></p>



<pre class="wp-block-code"><code>wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz</code></pre>



<p>After that, you need to unpack the archive that you just downloaded. You can do it like this:</p>



<pre class="wp-block-code"><code>tar xzf Python-3.9.6.tgz</code></pre>



<p>Next, compile the <strong>Python</strong> source</p>



<pre class="wp-block-code"><code>cd Python-3.9.6 &amp;&amp; ./configure --enable-optimizations</code></pre>



<p>This is followed by the installation of your Python. Use the following command:</p>



<pre class="wp-block-code"><code>make altinstall</code></pre>



<p>After that, a mandatory step for execution will be to check the name of your new Python executable file</p>



<pre class="wp-block-code"><code>ls /usr/local/bin/python*</code></pre>



<p>Then Install the new default Python executable. Replace the two instances of /python3.9 in the following command with the name of your new Python executable</p>



<pre class="wp-block-code"><code>alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.9 1 &amp;&amp; alternatives --set python3 /usr/local/bin/python3.9 &amp;&amp; echo "2" | alternatives --config python</code></pre>



<h2 id="update-your-pip" >Update your PIP</h2>



<p>An important step for this update is to update your <strong>pip</strong>.</p>



<pre class="wp-block-code"><code>/usr/local/bin/python3.9 -m pip install --upgrade pip</code></pre>



<p>Then you should check the name of your new <strong>pip</strong> executable</p>



<pre class="wp-block-code"><code>ls /usr/local/bin/pip*</code></pre>



<p>Set the new item as default. Use the name of your new pip executable in the following command:</p>



<pre class="wp-block-code"><code>alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.9 1 &amp;&amp; alternatives --set pip /usr/local/bin/pip3.9</code></pre>



<p>After that, you need to check the current version of your installed Python. You can make sure like this:</p>



<pre class="wp-block-code"><code>python -V &amp;&amp; pip -V</code></pre>



<p>After that, you will be able to see the following:</p>



<pre class="wp-block-code"><code>Python-3.9.6
pip 21.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-do-i-upgrade-my-python-on-centos-8/feed/</wfw:commentRss>
			<slash:comments>498</slash:comments>
		
		
			</item>
		<item>
		<title>How Do I Upgrade my Python on Debian</title>
		<link>https://help.hostry.com/knowledge-base/how-do-i-upgrade-my-python-on-debian/</link>
					<comments>https://help.hostry.com/knowledge-base/how-do-i-upgrade-my-python-on-debian/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 07:08:17 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=4161</guid>

					<description><![CDATA[In order for you to perform this operation to update your&#160;Python&#160;version, you need to update your CentOS 8 and have root rights for your VPS Checking Your Python Version In order to go to upgrade your python, you need to check its version. This can be done using the following [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>In order for you to perform this operation to update your&nbsp;<strong>Python</strong>&nbsp;version, you need to update your CentOS 8 and have root rights for your VPS</p>



<h2 id="checking-your-python-version" id="checking-your-python-version" >Checking Your Python Version</h2>



<p>In order to go to upgrade your python, you need to check its version. This can be done using the following command:</p>



<pre class="wp-block-code"><code>python3 -V</code></pre>



<p>If python is successfully installed on your server, then you should get something like this:</p>



<pre class="wp-block-code"><code>Python 3.6.7</code></pre>



<h2 id="updating-your-python-version" >Updating your Python Version</h2>



<p>First, you need to install the required dependencies to compile the Python source code. This can be done using a special command, which is presented below:</p>



<pre class="wp-block-code"><code># apt-get install wget build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev liblzma-dev -y</code></pre>



<p>After that, we recommend going to the <strong><a href="https://www.python.org/downloads/source/">Python</a></strong> source download page to find the latest gzip version of the source code. Replace the urls and filenames in this tutorial with the latest version. Then download your <strong>python</strong></p>



<pre class="wp-block-code"><code>wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz</code></pre>



<p>After that, you need to unpack the archive that you just downloaded. You can do it like this:</p>



<pre class="wp-block-code"><code>tar xzf Python-3.9.6.tgz</code></pre>



<p>Next, compile the&nbsp;<strong>Python</strong>&nbsp;source</p>



<pre class="wp-block-code"><code>cd Python-3.9.6 &amp;&amp; ./configure --enable-optimizations</code></pre>



<p>This is followed by the installation of your Python. Use the following command:</p>



<pre class="wp-block-code"><code>make altinstall</code></pre>



<p>After that, a mandatory step for execution will be to check the name of your new Python executable file</p>



<pre class="wp-block-code"><code>ls /usr/local/bin/python*</code></pre>



<p>Then Install the new default Python executable. Replace the two instances of <strong>/python3.9</strong> in the following command with the name of your new Python executable</p>



<pre class="wp-block-code"><code>update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1</code></pre>



<h2 id="update-your-pip" id="update-your-pip" >Update your PIP</h2>



<p>An important step for this update is to update your&nbsp;<strong>pip</strong>.</p>



<pre class="wp-block-code"><code>/usr/local/bin/python3.9 -m pip install --upgrade pip</code></pre>



<p>Then you should check the name of your new&nbsp;<strong>pip</strong>&nbsp;executable</p>



<pre class="wp-block-code"><code>ls /usr/local/bin/pip*</code></pre>



<p>Set the new item as default. Use the name of your new pip executable in the following command:</p>



<pre class="wp-block-code"><code>update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.9 1</code></pre>



<p>After that, you need to check the current version of your installed Python. You can make sure like this:</p>



<pre class="wp-block-code"><code>python -V &amp;&amp; pip -V</code></pre>



<p>After that, you will be able to see the following:</p>



<pre class="wp-block-code"><code>Python-3.9.6
pip 21.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-do-i-upgrade-my-python-on-debian/feed/</wfw:commentRss>
			<slash:comments>538</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install Puthon 3.7 on Arch Linux Web Server</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-puthon-3-7-on-arch-linux-web-server/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-puthon-3-7-on-arch-linux-web-server/#respond</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Fri, 07 Feb 2020 15:04:59 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=1371</guid>

					<description><![CDATA[This guide will help you install Python on Arch Linux. For this you need: Hostry vps Server running on Arch Linux, running Apache or Nginx web server, access to sudo and also installed text editor. Install Python 3.7 on your web server On Nginx To use Python 3.x (any version), [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>This guide will help you install Python on Arch Linux. For this you need: <strong><em><a href="https://hostry.com/products/vps/">Hostry vps Server</a></em></strong> running on Arch Linux, running Apache or Nginx web server, access to sudo and also installed text editor. </p>



<h2 id="install-python-3-7-on-your-web-server" >Install Python 3.7 on your web server </h2>



<p>On Nginx</p>



<p>To use Python 3.x (any version), you must enter the following:  </p>



<pre class="wp-block-code"><code># pacman -S uwsgi-plugin-python</code></pre>



<h2 id="test-python" >Test python </h2>



<p>In the appropriate <strong>test.py</strong> directory, the contents are listed below: </p>



<pre class="wp-block-code"><code>#-*- coding: utf-8 -*-
def wsgi_app(environment, start_response):
    import sys
    output = sys.version.encode('utf8')
    status = '200 OK'
    headers = [('Content-type', 'text/plain'),
               ('Content-Length', str(len(output)))]
    start_response(status, headers)
    yield output

application = wsgi_app</code></pre>



<p>On Apache </p>



<p>Add <strong><em>/etc/httpd/conf/httpd.conf</em></strong> to the end or edit the corresponding configuration file and then add to the corresponding &lt;VirtualHost&gt; block:</p>



<pre class="wp-block-code"><code>WSGIScriptAlias /wsgi_app /srv/http/test.py</code></pre>



<p>Restart Apache</p>



<pre class="wp-block-code"><code># systemctl restart httpd</code></pre>



<p>Follow the link in the browser <strong>http:// YOUR-SERVER-WEB-ADDRESS-OR-IP/wsgi_app</strong> and you can see a text page with all versions of Python and GCC.</p>



<p>Delete the <strong><em>test.py</em></strong> test file you just created and <strong><em>WSGIScriptAlias ​​</em></strong>in your Apache configuration.</p>



<p>On Nginx</p>



<p>Create the file<strong> /etc/uwsgi/wsgi_app.ini </strong>with the following contents:</p>



<pre class="wp-block-code"><code>[uwsgi]
socket = /run/uwsgi/wsgi_app.sock
uid = http
gid = http
plugins = python
chdir = /usr/share/nginx/html/
wsgi-file=test.py
callable = application</code></pre>



<p>Start service <strong>uWSGI wsqi_app:</strong></p>



<pre class="wp-block-code"><code># systemctl start uwsgi@wsgi_app</code></pre>



<p>You need to give Nginx permission to use uWSGI by editing <strong>/etc/nginx/nginx.conf</strong>, and for each server block that you want to test, add the following. Alternatively, if you use virtual hosts, edit the configuration file for each host:</p>



<pre class="wp-block-code"><code>location ~ \wsgi_app {
    root /usr/share/nginx/html/;
    include uwsgi_params;
    uwsgi_pass unix:/run/uwsgi/wsgi_app.sock;
}</code></pre>



<p>Restart Nginx:</p>



<pre class="wp-block-code"><code># systemctl restart nginx</code></pre>



<p>Visit your web browser, <strong>http://YOUR-SERVER-WEB-ADDRESS-OR-IP/wsgi_app </strong>and you will see a test page with versions of Python and GCC.</p>



<p>Delete the test.py file you just created and the location block you just added<strong> /etc/nginx/nginx.conf to wsgi_app.</strong></p>



<p>Restart Nginx</p>



<pre class="wp-block-code"><code># systemctl restart nginx</code></pre>



<p>Stop serving<strong> uWSGI wsgi_app:</strong></p>



<pre class="wp-block-code"><code># systemctl stop uwsgi@wsgi_app</code></pre>



<p>In the final episode, you need to delete<strong> /etc/uwsgi/wsgi_app.ini</strong>, test files, who you created earlier. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-puthon-3-7-on-arch-linux-web-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Python 2 on Ubuntu 20.04</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-python-2-on-ubuntu-20-04/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-python-2-on-ubuntu-20-04/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Tue, 26 May 2020 08:00:18 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=1726</guid>

					<description><![CDATA[Python 2 has been removed from Ubuntu, but if you use programs that are more obsolete, then you need Python. It must be installed and configured. Install Python 2 Connect to your server Ubunt 20.04 and install Python 2 with apt. Check out the Python version Check available Python versions [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><a href="https://www.python.org/downloads/release/python-272/">Python 2</a></strong><a href="https://www.python.org/downloads/release/python-272/"> </a>has been removed from Ubuntu, but if you use programs that are more obsolete, then you need Python. It must be installed and configured.</p>



<h2 id="install-python-2" >Install Python 2</h2>



<p>Connect to your server Ubunt 20.04 and install Python 2 with apt.</p>



<pre class="wp-block-code"><code>$ sudo apt install python2</code></pre>



<p>Check out the Python version</p>



<pre class="wp-block-code"><code>$ python2 -V
Python 2.7.17</code></pre>



<h2 id="check-available-python-versions" >Check available Python versions</h2>



<p>It is necessary to check the available versions in the system</p>



<pre class="wp-block-code"><code>$ ls /usr/bin/python*
/usr/bin/python2  /usr/bin/python2.7  /usr/bin/python3  /usr/bin/python3.8</code></pre>



<p>Next, look for customized Python alternatives</p>



<pre class="wp-block-code"><code>$ sudo update-alternatives --list python
update-alternatives: error: no alternatives for python</code></pre>



<h2 id="install-alternate-versions" >Install alternate versions</h2>



<p>To do this, install alternatives to Python 2 and Python 3.</p>



<pre class="wp-block-code"><code>$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2</code></pre>



<p>Make sure both of these alternatives work ready to use.</p>



<pre class="wp-block-code"><code>$ sudo update-alternatives --list python
/usr/bin/python2
/usr/bin/python3</code></pre>



<p>Choose an alternate version of Python.</p>



<pre class="wp-block-code"><code>$ sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3   2         auto mode
  1            /usr/bin/python2   1         manual mode
  2            /usr/bin/python3   2         manual mode

Press &lt;enter> to keep the current choice[*], or type selection number: 1</code></pre>



<p>Enter your selection, on<strong><em> Python 2</em></strong>.</p>



<p>Check out the Python version:</p>



<pre class="wp-block-code"><code>$ python -V
Python 2.7.18rc1</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-python-2-on-ubuntu-20-04/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install Python 3.9 on Debian 10</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-python-3-9-on-debian-10/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-python-3-9-on-debian-10/#respond</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Tue, 09 Mar 2021 10:27:36 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=3302</guid>

					<description><![CDATA[Python is one of the most requested and also popular programming languages. It is a versatile language that is good for building all kinds of applications, from simple scripts to complex machine learning algorithms. Python, with its simple and easy-to-learn syntax, is a popular choice for both beginners and experienced [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong>Python</strong> is one of the most requested and also popular programming languages. It is a versatile language that is good for building all kinds of applications, from simple scripts to complex machine learning algorithms. Python, with its simple and easy-to-learn syntax, is a popular choice for both beginners and experienced developers.<strong> Python 3.9. 2</strong> is the latest major version of the Python language (Updated 19 February 2021). It includes many new features such as new dict operators, new str features, <strong>IANA</strong> timezone support, and more.</p>



<h2 id="installing-python-3-9-2-on-debian-10" >Installing Python 3.9.2 on Debian 10</h2>



<p>Compiling <strong>Python</strong> from source allows you to install the latest version of Python and customize your build options. However, you will not be able to support installing Python through the apt package manager. Building <strong>Python 3.9.2 </strong>on <strong>Debian</strong> is a relatively straightforward process that only takes a few minutes. So, the first thing to do is to install all the dependencies that will be needed in order to build Python. This can be done using the following command:</p>



<pre class="wp-block-code"><code>apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev</code></pre>



<p>Then you need to download the latest source code from the Python download page using <strong>wget</strong>:</p>



<pre class="wp-block-code"><code>wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz</code></pre>



<p>After successfully completing the download, you should immediately unpack the archive. This is available with the command described below:</p>



<pre class="wp-block-code"><code>tar -xf Python-3.9.1.tgz</code></pre>



<p>Next, you need to go to your Python source directory and run configure:</p>



<pre class="wp-block-code"><code>cd Python-3.9.2
./configure --enable-optimizations</code></pre>



<p>The <strong>-enable-optimizations</strong> option optimizes the Python binary by running multiple tests. The script runs a series of checks to ensure that all dependencies are present on your system by running the Python 3.9.2 build process:</p>



<pre class="wp-block-code"><code>make -j 2</code></pre>



<p>When the build process has successfully progressed to completion, the next step is to install the <strong>Python</strong> binaries by typing:</p>



<pre class="wp-block-code"><code>make altinstall</code></pre>



<p>This completes the installation and initial configuration of Python. Python is ready to use, to test this, you can enter the command:</p>



<pre class="wp-block-code"><code>python3.9 --version</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-python-3-9-on-debian-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
