latest procedure to install python and packages (Jan.27, 2017)

Happy Chinese New Year!

I have to use a search tool to get information and it’s complicated. I need python to finish this task. (I still did not figure it out with help of SDE and DS friends who are good at coding. I’ll need my husband’s help. 🙂  )

I tried on Windows and it did not work well, so I switched to Mac. Here are the notes to install python and packages on mac (I tried lots of method online and I want to share my experience with those who don’t have much coding experience, just like myself.).

Python installation and package installation latest procedure on Mac (Jan 27,2017):

  1. Install python 2.7 on Mac   https://www.python.org/downloads/
  2. Install anaconda   https://www.continuum.io/downloads ( I guess this is the right link, not sure.)
  3. Open Terminal and follow the instruction in the link (need to change ‘yourenvname’ into ‘anaconda’, very important!!!! It took me long time to figure this out.)

https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/

# To activate this environment, use:

source activate anaconda

# To deactivate this environment, use:

source deactivate anaconda

  1. Then this is an example about how to install beautifulsoup and urllib2 as extra packages. We can create virtual environments for python with conda.

In the Terminal, we need to type in a word conda, and then click enter button. Then we can install package beautifulsoup and urllib2 using codes as follows.

conda install -n anaconda [beautifulsoup]

conda install -n anaconda [urllib2]

Notes:

beautifulsoup doc in Chinese:

https://www.crummy.com/software/BeautifulSoup/bs3/documentation.zh.html#Quick%20Start

beautifulsoup doc in English:

https://www.crummy.com/software/BeautifulSoup/bs3/documentation.html

Enjoy!!!

If it does not work for you, you might need to try different methods online. You can also  leave a message for me. I’ll reply if I can help.

Leave a Comment