Creating a coding exercise: How to install a python library in a coding exercise?

In my new course draft I need to create coding exercise in python. This code needs external libraries such as numpy, pandas, matplotlib, statsmodel to be imported in the "exercise.py" and "evaluate.py".

I tried "import pandas as pd" but it gave an error "No module named 'pandas'".

Error suggests that the pandas needs to be installed before it can be imported. I tried "pip install pandas" and "!pip install pandas" in "exercise.py" and "evaluate.py" but it did not work.

Any suggestions on how an external library could be installed for coding exercise would be appreciated. Thank you for your time.

Answers

  • Carolina M.
    Carolina M. Posts: 276 Udemy rank

    Hi @runtime

    Thank you for your question!

    If you are having any issues with your coding exercises, we'd recommend reaching out to our support team. They should be able to guide you and even let you know if we're having any known issues with libraries, for example.

    To reach to our support team, please click here. Then, click on the "Contact Us" button at the bottom-right corner of the article. If you are receiving any errors, sending a screenshot along with your question would be very helpful as well.

    I hope this helps! Please let me know if you have any other questions 😊

  • Appreciate your reply. I have reached out to support team.

  • Hi @nileshingle I wonder if you can share your experience with installing custom packages for coding exercises?