Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 5.28 KB

setup-environment.md

File metadata and controls

57 lines (37 loc) · 5.28 KB

Setup Python Environment on Windows and MAC

MAC

Modern Mac OS versions come with Python 2.7.x installed (or Python 2.6.1 if an older Mac OS X version), but with several reasons, many Python users may need to update Python in Mac OS to a newer version like Python 3.

  • You can typepython --versionin terminal to check out the version on your computer.

How to Install the Updated Python 3 in Mac OS X

  1. by using the Python package installer from python.org

    Once Python 3 is installed you will find a Python3 folder within the /Applications directory of your Mac.

  2. Install Python 3 with Homebrew

Windows

The Unix/ Linux world has a collection tools that nicely work together. However, you will need to troubleshoot environment frequently on Windows. I suggest you to use MAC or rely on our lab for this semester, to reduce such hassle. Once you master the essence, it is easier to move to other environments later.I have not used Windows for a long time. There are problems stitching things together. For those who have tried/ are trying Windows, please share your experience, no matter it is successful case or not. Here are some pointers to get started.

Install Python3 on Windows and Set Environment

This question is usually accompanied by another problem/error:

不是内部或外部命令,也不是可运行的程序或批处理文件
or
‘python’ is not recognized as an internal or external command

Details please see here.

Other integrated environments you can consider

There exists some integrated environments that get you the full dependencies in one shot. You don't have to worry about the environment as a beginner. Those solutions are very easy to try so we do not repeat their own documentations here. Please find some choices as follows:

Difference between conda and pip

conda and pip are both package managers. pip is the default package manager shipped with Python core. conda is the package manager for "Anaconda" distribution, powered by Continuum Analytics, a commercial company. Find many insightful discussions on StackOverflow thread and also misconceptions of Anaconda summarised by Continuum Analytics itself. Here are some highlights:

  • For beginners or Windows users, if you have trouble trying out other solutions, Anaconda distribution may be more direct. It saves the bootstrapping time.
  • If possible, we suggest to stick with pip, or its offsprings because of the support of Python core community. Note that easy_install was once a mainstream solution before pip took off. Python community is always evolving. The latest packaging solution is Pipfile and pipenv. Since it is not as stable as pip yet, we will leave this to self testing for those who are interested.
  • conda had the advantages of 1) able to install binary packages (pre-compiled packages) and 2) install non-Python packages. The first advantage was once prevailing, especially on Windows because Windows usually lack the dependencies to compile the packages from source codes. It is less significant now, since latest pip also supports to install binaries. Another advancement is pipenv who highlighted in the project pitch text that Windows is a first-class citizen, in our world.