python3.rst 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ============================
  2. Introducing Python 3 support
  3. ============================
  4. .. _Python 2.7 clock: https://pythonclock.org/
  5. .. sidebar:: Python 2.7 to 3 upgrade
  6. This chapter exists of historical reasons. Python 2.7 release schedule ends
  7. (`Python 2.7 clock`_) after 11 years Python 3 exists
  8. As most operation systems are coming with Python3 installed by default. So it is
  9. time for searx to support Python3. But don't worry support of Python2.7 won't be
  10. dropped.
  11. .. image:: searxpy3.png
  12. :scale: 50 %
  13. :alt: hurray
  14. :align: center
  15. How to run searx using Python 3
  16. ===============================
  17. Please make sure that you run at least Python 3.5.
  18. To run searx, first a Python3 virtualenv should be created. After entering the
  19. virtualenv, dependencies must be installed. Then run searx with python3 instead
  20. of the usual python command.
  21. .. code:: sh
  22. virtualenv -p python3 venv3
  23. source venv3/bin/activate
  24. pip3 install -r requirements.txt
  25. python3 searx/webapp.py
  26. If you want to run searx using Python2.7, you don't have to do anything
  27. differently as before.
  28. Fun facts
  29. =========
  30. - 115 files were changed when implementing the support for both Python versions.
  31. - All of the dependencies was compatible except for the robotframework used for
  32. browser tests. Thus, these tests were migrated to splinter. So from now on
  33. both versions are being tested on Travis and can be tested locally.
  34. If you found bugs
  35. =================
  36. Please open an issue on `GitHub`_. Make sure that you mention your Python
  37. version in your issue, so we can investigate it properly.
  38. .. _GitHub: https://github.com/searx/searx/issues
  39. Acknowledgment
  40. ==============
  41. This development was sponsored by `NLnet Foundation`_.
  42. .. _NLnet Foundation: https://nlnet.nl/
  43. | Happy hacking.
  44. | kvch // 2017.05.13 22:57