0

I had made a bot on python using python-telegram-bot, but I am getting an error on pushing this code on Heroku on the command line.

my whole code is on python-telegram-bot but it gives me an error on uploading this from requirements.txt

I had cut some libraries which are uploaded without any error.

My error:-

PS D:\Code\python projects\Buddy_telegram_bot> git push heroku master
Enumerating objects: 29, done.
Counting objects: 100% (29/29), done.
Delta compression using up to 8 threads
Compressing objects: 100% (26/26), done.
Writing objects: 100% (29/29), 58.49 KiB | 5.85 MiB/s, done.
Total 29 (delta 10), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote:  !     Python has released a security update! Please consider upgrading to python-3.9.6
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.5
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting aiohttp==3.7.4.post0
remote:          Downloading aiohttp-3.7.4.post0-cp39-cp39-manylinux2014_x86_64.whl (1.4 MB)
remote:        Collecting pypiwin32==223
remote:          Downloading pypiwin32-223-py3-none-any.whl (1.7 kB)
remote:        Collecting python-dotenv==0.18.0
remote:          Downloading python_dotenv-0.18.0-py2.py3-none-any.whl (18 kB)
remote:        Collecting python-telegram-bot==13.7
remote:          Downloading python_telegram_bot-13.7-py3-none-any.whl (455 kB)
remote:        ERROR: Could not find a version that satisfies the requirement pywin32==301 (from -r /tmp/build_f1a97cf9/requirements.txt (line 32)) (from versions: none)
remote:        ERROR: No matching distribution found for pywin32==301 (from -r /tmp/build_f1a97cf9/requirements.txt (line 32))
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to buddy-telegram-bot.
remote:
To https://git.heroku.com/buddy-telegram-bot.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/buddy-telegram-bot.git'

Here I am getting an error on python-telegram-bot but I need it in my program

Please help me to solve this.

  • 1
    Does this answer your question? [Heroku fails to install pywin32 library](https://stackoverflow.com/questions/50026190/heroku-fails-to-install-pywin32-library) – ChrisGPT was on strike Aug 08 '21 at 15:23
  • no this is not my answer – K. learner Aug 14 '21 at 08:59
  • Yes, it is. Please read the entire question and all answers closely: your error is that you are trying to install `pywin32` on Heroku. That library should not be in your `requirements.txt` since it is not a dependency. (And if it _is_ a dependency, your application will not be able to run on Heroku since Heroku does not run Windows servers.) – ChrisGPT was on strike Aug 14 '21 at 11:59
  • Side note: when telling people that something they suggested doesn't work, please explain _why_ you think it doesn't apply. We can't help you if you don't put in a bit of effort. Please read [ask]. – ChrisGPT was on strike Aug 14 '21 at 12:02
  • sorry sir I had found my error but there is another error – K. learner Aug 15 '21 at 14:17
  • `Downloading yarl-1.6.3-cp39-cp39-manylinux2014_x86_64.whl (315 kB) remote: ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32==223->-r /tmp/build_fe4dfd98/requirements.txt (line 29)) (from versions: none) remote: ERROR: No matching distribution found for pywin32>=223 (from pypiwin32==223->-r /tmp/build_fe4dfd98/requirements.txt (line 29)) remote: ! Push rejected, failed to compile Python app.` – K. learner Aug 15 '21 at 14:18
  • I had removed pywin32 from my requirements.txt – K. learner Aug 15 '21 at 14:21
  • That comment _still_ says you're trying to install `pywin32`. Make sure you _commit_ the updated `requirements.txt` and include that commit when you push. – ChrisGPT was on strike Aug 15 '21 at 15:50
  • Thank you, sir, it worked, there are two pywin32 in my requirements.txt. I missed one of them so that gives me an error. Thank you very much, sir. – K. learner Aug 15 '21 at 16:44

0 Answers0