Reputation: 100
I made a django app with pafy (I used the modified version, because the official one gives errors check this https://github.com/mps-youtube/pafy/pull/305) and when I push it to heroku I get errors here's the requirements.txt file
# asgiref @ file:///tmp/build/80754af9/asgiref_1625643473416/work
beautifulsoup4==4.10.0
certifi==2021.10.8
dj-database-url==0.5.0
# Django @ file:///tmp/build/80754af9/django_1625585912945/work
django-bootstrap-datepicker-plus==4.0.0
django-bootstrap4==21.2
django-heroku==0.3.1
Faker==11.3.0
gunicorn==20.1.0
# psycopg2 @ file:///tmp/build/80754af9/psycopg2_1612298595717/work
python-dateutil==2.8.2
pytz==2021.3
six==1.16.0
soupsieve==2.3.1
# sqlparse @ file:///tmp/build/80754af9/sqlparse_1602184451250/work
text-unidecode==1.3
# typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1631814937681/work
whitenoise==5.3.0
# pafy==0.5.5
# youtube_dl==2021.12.17
youtube-dl==2021.6.6
pafy
-e git+git://github.com/Cupcakus/pafy.git@develop#egg=pafy
I tried removing pafy, tried other versions but it doesn't solve it here's the log
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in runtime.txt
-----> Requirements file has been changed, clearing cached dependencies
-----> Installing python-3.9.10
-----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
-----> Installing SQLite3
-----> Installing requirements with pip
Obtaining pafy from git+git://github.com/Cupcakus/pafy.git@develop#egg=pafy (from -r /tmp/build_9f9c42b0/requirements.txt (line 24))
Cloning git://github.com/Cupcakus/pafy.git (to revision develop) to /app/.heroku/src/pafy
Running command git clone --filter=blob:none -q git://github.com/Cupcakus/pafy.git /app/.heroku/src/pafy
Resolved git://github.com/Cupcakus/pafy.git to commit 45f0deb067bf7c420cdf83a0529fd5274c12de18
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/app/.heroku/src/pafy/setup.py'"'"'; __file__='"'"'/app/.heroku/src/pafy/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-eu9a5bj6
cwd: /app/.heroku/src/pafy/
Complete output (16 lines):
Traceback (most recent call last):
File "/app/.heroku/src/pafy/pafy/pafy.py", line 48, in <module>
import youtube_dl
ModuleNotFoundError: No module named 'youtube_dl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/app/.heroku/src/pafy/setup.py", line 13, in <module>
from pafy import __version__
File "/app/.heroku/src/pafy/pafy/__init__.py", line 7, in <module>
from .pafy import new
File "/app/.heroku/src/pafy/pafy/pafy.py", line 51, in <module>
raise ImportError(
ImportError: pafy: youtube-dl not found; you can use the internal backend by setting the environmental variable PAFY_BACKEND to "internal". It is not enabled by default because it is not as well maintained as the youtube-dl backend.
----------------------------------------
WARNING: Discarding git+git://github.com/Cupcakus/pafy.git@develop#egg=pafy. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Collecting beautifulsoup4==4.10.0
Downloading beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
Collecting certifi==2021.10.8
Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting dj-database-url==0.5.0
Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
Collecting django-bootstrap-datepicker-plus==4.0.0
Downloading django_bootstrap_datepicker_plus-4.0.0-py3-none-any.whl (16 kB)
Collecting django-bootstrap4==21.2
Downloading django_bootstrap4-21.2-py3-none-any.whl (24 kB)
Collecting django-heroku==0.3.1
Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
Collecting Faker==11.3.0
Downloading Faker-11.3.0-py3-none-any.whl (1.2 MB)
Collecting gunicorn==20.1.0
Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
Collecting python-dateutil==2.8.2
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz==2021.3
Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
Collecting six==1.16.0
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting soupsieve==2.3.1
Downloading soupsieve-2.3.1-py3-none-any.whl (37 kB)
Collecting text-unidecode==1.3
Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Collecting whitenoise==5.3.0
Downloading whitenoise-5.3.0-py2.py3-none-any.whl (19 kB)
Collecting youtube-dl==2021.6.6
Downloading youtube_dl-2021.6.6-py2.py3-none-any.whl (1.9 MB)
Collecting pafy
Downloading pafy-0.5.5-py2.py3-none-any.whl (35 kB)
Collecting django<5,>=2
Downloading Django-4.0.1-py3-none-any.whl (8.0 MB)
Collecting psycopg2
Downloading psycopg2-2.9.3.tar.gz (380 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
status = run_func(*args)
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 338, in run
requirement_set = resolver.resolve(
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
result = self._result = resolver.resolve(
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 482, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 374, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/app/.heroku/python/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 228, in _attempt_to_pin_criterion
raise InconsistentCandidate(candidate, criterion)
pip._vendor.resolvelib.resolvers.InconsistentCandidate: Provided candidate LinkCandidate('https://files.pythonhosted.org/packages/74/69/829919eeadff695338f98fa12bb99e45490761a2010c8d688d88b6df194a/pafy-0.5.5-py2.py3-none-any.whl#sha256=769e35aa6988686d47fa2ab235d15c9952c7873c470f6a6b05cf6bcd93e62515 (from https://pypi.org/simple/pafy/)') does not satisfy SpecifierRequirement('pafy'), UnsatisfiableRequirement('pafy')
! Push rejected, failed to compile Python app.
! Push failed
EDIT: The problem was that I couldn't install youtube-dl before installing pafy (I was installing a specific version because of the bug that occured in pafy after youtube disabled the dislike count so I had to install another version) so I moved to pythonanywhere.com where I could use the terminal to install it manually and it worked fine.
Upvotes: 0
Views: 253