Changes

Jump to navigation Jump to search
1,472 bytes added ,  13:42, 21 November 2017
Created page with "There are two production versions of Python: Python 2 and Python 3. * You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/li..."
There are two production versions of Python: Python 2 and Python 3.

* You can run scripts written for 3 with 2 if you import the special package [https://docs.python.org/2/library/__future__.html <code>__future__</code>]
* You can run scripts written for 2 with 3 if you run the script [https://docs.python.org/3.1/library/2to3.html <code>2to3</code>]
* '''All new code should be written in Python 3''' for library support and maintainability reasons. If for no other reason know that it uses UTF-8 as the default encoding and so it makes your life easier in every possible way.

== Installation ==

Many Python modules are actually 90% low-level C code with the remaining 10% a python wrapper.
That means to install these modules (e.g. numpy, scipy, hdf) you need to have all of the development libraries and compiler tools to compile the C stuff.
Enter [https://anaconda.org/ Anaconda], a widely used repackaging of Python for Windows that comes with most of the libraries you'll ever need.
In addition, they've made it easy to have two installs of Python running at once.

* Python2
** Python 2.7.14 via Anaconda2 5.0.1 for 64-bit
** Located at <code>C:\ProgramData\Anaconda2</code>*

* Python3
** Python 3.6.3 via Anaconda3 5.0.1 for 64-bit
** Located at <code>C:\ProgramData\Anaconda3</code>*

<nowiki>*</nowiki> Note that Anaconda is not installed in <code>C:\Program Files\AnacondaN</code> intentionally. Spaces in the path lead to a bunch of unpredictable errors.

Navigation menu