python-novice-inflammation
python-novice-inflammation copied to clipboard
Ep. 11: Issues with numpy
I was attempting to teach episode 11 and ran into this error with: $ python ../code/readings_04.py --mean inflammation-01.csv and I get:
$python readings_04.py --mean ../data/inflammation-01.csv
Traceback (most recent call last):
File "readings_04.py", line 2, in
I have googled and read stackoverflow but can't figure out what is going wrong...never seen this before.
HI @dakane1 . It looks possible that the version/instance of Python you are running at the commandline does not have numpy
installed. Were you able to use import numpy
in Jupyter Notebook? It could be the system Python you are using at that prompt is different than the one that Jupyter Notebook is using and does not have numpy
installed.
Hmm, yes it worked fine in Jupyter Notebook. I will do some testing to see what my command line is set to. Thanks for pointing me in a direction to investigate further :-).
I think the second scenario that Lauren described is what is happening here: there is a good chance that you used system's Python when you tried executing the script with python
.
I think we should add a callout box the first time we try to execute a Python script. What do you all think?
@maxim-belkin I think adding a callout box would be helpful to many users.