1

I'm using requirements to install all of my project's packages. But, for some packages, I can't find the right version or if I need to place it in requirements.txt and I need help to deploy it correctly in my project on Heroku. I'm not sure if I'm doing this correctly.

Here what I have in my code:

import time
import pandas as pd
import sys
import numpy as np
import time
import os
import win32com.client as win32 #manipulate windows objects
import pythoncom
import gspread

from flask import Flask
from flask import request

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options

from model_files import filemanager
from datetime import date, timedelta, datetime


And here how I use in requirements.txt

Flask==1.1.1
pandas==1.0.3
numpy==1.18.1
scikit_learn==0.23.1
gunicorn==20.0.4
Werkzeug==0.16.0
Jinja2==2.10.1
itsdangerous==1.1.0
MarkupSafe==1.1.1
selenium==3.0.2

``
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

1

Why are you doing it manually? If you work in a virtual environment, you can just generate requirements.txt automatically:

pip freeze > requirements.txt

As explained here (possible duplicate).

miquelvir
  • 1,748
  • 1
  • 7
  • 21
  • Thank @miquelvir. But should I use this code in deploying to Heroku? How? – Cristiano Amancio Mar 27 '21 at 15:45
  • Run this before deploying on your terminal; this will create the requirements.txt for you. Then deploy as usual. https://devcenter.heroku.com/articles/getting-started-with-python#deploy-the-app – miquelvir Mar 27 '21 at 16:21