osx - Using pip modules in python Mac OS -


i having trouble using installed packages on mac. have attached picture terminal code.

terminal , code

any appreciated!

running python 3 framework

you have make sure have proper python 3 packages installed.

pip3 install pandas pip3 install quandl 

then try running script again. looks installing python 2 packages (see ...versions/2.7... in output.

you can try which pip see pip application being run , check version pip --version.


running conda

conda serves package manager (similar pip) virtual environment (similar virtualenv virtualenv docs). if running in conda environment, should install package dependencies conda (not pip).

installing dependencies conda

with conda can install package dependencies when first create python environment:

conda create -n my_env pandas quandl 

or can add packages existing environment:

conda install -n my_env2 pandas quandl 

conda solution

  1. make new conda environment

conda create my_solution pandas quandl

  1. activate environment

source activate my_solution

# verify it's activated (should have * it; don't type $)
$ conda info --envs

# conda environments:
#
my_solution * /users/{name}/anaconda3/envs/my_solution
root /users/{name}/anaconda3

  1. execute script

$ python linear-regression.py

              open    high     low    close      volume  ex-dividend  \ date 2004-08-19  100.01  104.06   95.96  100.335  44659000.0          0.0 2004-08-20  101.01  109.08  100.50  108.310  22834300.0          0.0 2004-08-23  110.76  113.48  109.05  109.400  18256100.0          0.0 2004-08-24  111.24  111.60  103.57  104.870  15247300.0          0.0 2004-08-25  104.76  108.00  103.88  106.000   9188600.0          0.0              split ratio  adj. open  adj. high   adj. low  adj. close  \ date 2004-08-19          1.0  50.159839  52.191109  48.128568   50.322842 2004-08-20          1.0  50.661387  54.708881  50.405597   54.322689 2004-08-23          1.0  55.551482  56.915693  54.693835   54.869377 2004-08-24          1.0  55.792225  55.972783  51.945350   52.597363 2004-08-25          1.0  52.542193  54.167209  52.100830   53.164113              adj. volume date 2004-08-19   44659000.0 2004-08-20   22834300.0 2004-08-23   18256100.0 2004-08-24   15247300.0 2004-08-25    9188600.0 

note: in script, changed refs quandl quandl.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -