Installing Python Packages on Mac OS X using Conda

I tried many options but the below method worked for me to install the packages on Mac OS X!

Got the instructions from the youtube video https://www.youtube.com/watch?v=kTmXHijG8ao&t=45s

Note: the content you see in bold and italic below are to be substituted by names you would like to have / that you downloaded

Step 1: Download the appropriate file from the site https://conda.io/miniconda.html
Step2: Go to Terminal; change the folder to Downloads and execute below command

bash filename

As the installation starts, you will have to either enter yes or y or press enter as prompted.

You need to open the terminal in new window to have the next set of commands work

source activate myenv

conda create -n myenv python=3.6.3

I used 3.6.3 in the above command as that's the version of Python I had installed.

conda install numpy scipy matplotlib

You can install many other packages also using the format "conda install "

However, sometimes, there will be an error saying that the package is not found in certain channels. In such case, you will have to configure and add related channels to conda.

For example, I could install openpyxl package using the command "conda install openpyxl"

But could not install python-docx using the command "conda install python-docx"
I got an error saying that the package is not found in below channels....

Then, I followed instructions to forge channel as specified in https://github.com/conda-forge/python-docx-feedstock/blob/master/README.md

Note: Some of the packages like imutils were not supported by conda (refer to https://github.com/jrosebr1/imutils/issues/36). So, However, later I reverted to package installation thru pip.


Comments

Popular posts from this blog

Santa Clara (CA) DMV - Driving Test Practice Routes

Trip to Coorg from Bangalore