ines / course-starter-python

👩‍🏫🐍 Starter repo for building interactive Python courses
https://course-starter-python.netlify.com
MIT License
504 stars 118 forks source link

Install a package #18

Open AIITech opened 4 years ago

AIITech commented 4 years ago

Hi,

Thank you for this creative platform. It is amazing. I just want to ask how to install a python library. I am trying to import numpy library but I got this error ( No module named 'numpy' ). I tried to solve this problem by adding ( numpy==1.16.5 ) to ( binder/requirements.txt ) but I still get the same error. Could you tell me please how to add python packages to ( course-starter-python )?

Thanks in advance.

ines commented 4 years ago

I tried to solve this problem by adding ( numpy==1.16.5 ) to ( binder/requirements.txt ) but I still get the same error.

Yes, this should work. Make sure you actually add that change to the binder branch and then rebuild the Binder: https://github.com/ines/course-starter-python#setting-up-binder

hfboyce commented 4 years ago

Hi Ines,

I absolutely love this framework and all your work! I am having a similar problem where I have built my binder branch making sure to add

pandas==0.25.3
numpy>=1.11.0,<1.16.4 
scikit-learn==0.21.2

in the requirements.txt document. I have rebuilt everything and it appears that the modules are installed when reading the binder log but I'm still getting the error No module named 'pandas' running an exercise when I run the app on localhost:8000.

Do you have any ideas or troubleshooting suggestions?

hfboyce commented 4 years ago

This was resolved by not being silly and making a binder of the proper branch 🤦🏼‍♀️ When building the binder, it's important to specify the branch binder which I failed to do. WHOOPS!