| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | ============================
 | 
					
						
							|  |  |  | Introducing Python 3 support
 | 
					
						
							|  |  |  | ============================
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | .. _Python 2.7 clock: https://pythonclock.org/
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .. sidebar:: Python 2.7 to 3 upgrade
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    This chapter exists of historical reasons.  Python 2.7 release schedule ends
 | 
					
						
							|  |  |  |    (`Python 2.7 clock`_) after 11 years Python 3 exists
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | As most operation systems are coming with Python3 installed by default. So it is
 | 
					
						
							|  |  |  | time for searx to support Python3.  But don't worry support of Python2.7 won't be
 | 
					
						
							|  |  |  | dropped.
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-12 12:34:30 +02:00
										 |  |  | .. image:: searxpy3.png
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  |     :scale: 50 %
 | 
					
						
							|  |  |  |     :alt: hurray
 | 
					
						
							|  |  |  |     :align: center
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | How to run searx using Python 3
 | 
					
						
							|  |  |  | ===============================
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | Please make sure that you run at least Python 3.5.
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | To run searx, first a Python3 virtualenv should be created.  After entering the
 | 
					
						
							| 
									
										
										
										
											2021-05-26 09:45:09 +02:00
										 |  |  | virtualenv, dependencies and searx must be installed. Then run searx from the
 | 
					
						
							|  |  |  | command line.
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | .. code:: sh
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-26 09:45:09 +02:00
										 |  |  |     python3 -m venv venv3
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  |     source venv3/bin/activate
 | 
					
						
							| 
									
										
										
										
											2021-05-26 09:45:09 +02:00
										 |  |  |     pip install -U pip setuptools wheel pyyaml
 | 
					
						
							|  |  |  |     pip install -e .
 | 
					
						
							|  |  |  |     searx-run
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | Fun facts
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | =========
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | - 115 files were changed when implementing the support for both Python versions.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | - 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.
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | If you found bugs
 | 
					
						
							|  |  |  | =================
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | Please open an issue on `GitHub`_.  Make sure that you mention your Python
 | 
					
						
							|  |  |  | version in your issue, so we can investigate it properly.
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-25 12:03:54 +02:00
										 |  |  | .. _GitHub: https://github.com/searxng/searxng/issues
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | Acknowledgment
 | 
					
						
							|  |  |  | ==============
 | 
					
						
							| 
									
										
										
										
											2017-05-12 22:51:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | This development was sponsored by `NLnet Foundation`_.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .. _NLnet Foundation: https://nlnet.nl/
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | | Happy hacking.
 | 
					
						
							|  |  |  | | kvch // 2017.05.13 22:57
 |