searx/blog/python3.html

160 lines
7.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Introducing Python 3 support &#8212; Searx Documentation (Searx-1.0.0.tex)</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Searx admin interface" href="admin.html" />
<link rel="prev" title="Developing in Linux containers [202006]" href="lxcdev-202006.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="admin.html" title="Searx admin interface"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="lxcdev-202006.html" title="Developing in Linux containers [202006]"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.0.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Blog</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Introducing Python 3 support</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="introducing-python-3-support">
<h1>Introducing Python 3 support<a class="headerlink" href="#introducing-python-3-support" title="Permalink to this headline"></a></h1>
<div class="sidebar">
<p class="sidebar-title">Python 2.7 to 3 upgrade</p>
<p>This chapter exists of historical reasons. Python 2.7 release schedule ends
(<a class="reference external" href="https://pythonclock.org/">Python 2.7 clock</a>) after 11 years Python 3 exists</p>
</div>
<p>As most operation systems are coming with Python3 installed by default. So it is
time for searx to support Python3. But dont worry support of Python2.7 wont be
dropped.</p>
<a class="reference internal image-reference" href="../_images/searxpy3.png"><img alt="hurray" class="align-center" src="../_images/searxpy3.png" style="width: 510.5px; height: 116.0px;" /></a>
<div class="section" id="how-to-run-searx-using-python-3">
<h2>How to run searx using Python 3<a class="headerlink" href="#how-to-run-searx-using-python-3" title="Permalink to this headline"></a></h2>
<p>Please make sure that you run at least Python 3.5.</p>
<p>To run searx, first a Python3 virtualenv should be created. After entering the
virtualenv, dependencies must be installed. Then run searx with python3 instead
of the usual python command.</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>virtualenv -p python3 venv3
<span class="nb">source</span> venv3/bin/activate
pip3 install -r requirements.txt
python3 searx/webapp.py
</pre></div>
</div>
<p>If you want to run searx using Python2.7, you dont have to do anything
differently as before.</p>
</div>
<div class="section" id="fun-facts">
<h2>Fun facts<a class="headerlink" href="#fun-facts" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p>115 files were changed when implementing the support for both Python versions.</p></li>
<li><p>All of the dependencies was compatible except for the robotframework used for
browser tests. Thus, these tests were migrated to splinter. So from now on
both versions are being tested on Travis and can be tested locally.</p></li>
</ul>
</div>
<div class="section" id="if-you-found-bugs">
<h2>If you found bugs<a class="headerlink" href="#if-you-found-bugs" title="Permalink to this headline"></a></h2>
<p>Please open an issue on <a class="reference external" href="https://github.com/searx/searx/issues">GitHub</a>. Make sure that you mention your Python
version in your issue, so we can investigate it properly.</p>
</div>
<div class="section" id="acknowledgment">
<h2>Acknowledgment<a class="headerlink" href="#acknowledgment" title="Permalink to this headline"></a></h2>
<p>This development was sponsored by <a class="reference external" href="https://nlnet.nl/">NLnet Foundation</a>.</p>
<div class="line-block">
<div class="line">Happy hacking.</div>
<div class="line">kvch // 2017.05.13 22:57</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Blog</a>
<ul>
<li>Previous: <a href="lxcdev-202006.html" title="previous chapter">Developing in Linux containers [202006]</a>
<li>Next: <a href="admin.html" title="next chapter">Searx admin interface</a></ul>
</li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.3.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>