skip to Main Content

I copied a template codespace https://github.com/github/codespaces-flask and now whenever I need to add a new package pip install redis for example I have to add it to my requirements.txt and rebuild the entire codespace again.

What is the proper way of doing this?

Thank you in advance.

I tried searching GitHub codespaces documentation and following Docker tutorials. I didn’t find anything specific enough to answer my question.

2

Answers


  1. Try pip install -t target_directory to install directly into a specified folder

    Login or Signup to reply.
  2. Running pip install package_name in terminal will have the package installed for your current codespace build. You need not rebuild your codespace for those packages to work.

    But do also add pip install package_name for all your required packages to your requirements.txt, so that you don’t have to manually install these packages the next time you build a new codespace.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search