0

I have a NodeJS API and a Python script. I deployed it on Heroku. The API call runs the python scripts.

When I deployed the NodeJS API then type npm install and all works fine but not for python. There is a lot of pip package to install, how can I make this work same as in my local environment?

In short, what is the "One command to install them all"?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
nodermonch
  • 119
  • 1
  • 2
  • 9

1 Answers1

2

You should define your requirements in a requirements.txt file and then

pip install -r requirements.txt

will install all at the same time.

You can create it by

pip freeze > requirements.txt

but should include only the packages you really use.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
MSR974
  • 632
  • 3
  • 12
  • The txt file, how it will looks like pandas numpy ... or – nodermonch Aug 05 '20 at 12:00
  • each line contain the package name and the version your project depend on it's the same output as pip freeze (since pip freeze > requirements.txt; create the file requirements.txt from the pip freeze output) – MSR974 Aug 05 '20 at 12:02
  • "pip freeze > requirements.txt" okay then it works fine really. Just one more think I want to reset all my packages or should I say clean the pip installed packages.I am using anaconda in my local desktop – nodermonch Aug 05 '20 at 12:05
  • https://stackoverflow.com/questions/11248073/what-is-the-easiest-way-to-remove-all-packages-installed-by-pip – MSR974 Aug 05 '20 at 12:12
  • Okay I saw that but I did'nt understand until now the requirements.txt..Thank all of you – nodermonch Aug 05 '20 at 12:16
  • One last question, It gives a lot of error. It installs some packages but some of them with red big error.Is this because anaconda spyder – nodermonch Aug 05 '20 at 12:28
  • what kind of errors ? can you paste it here or create a new questions ? – MSR974 Aug 05 '20 at 12:41