pythonflaskherokudeploymentpyobjc

PyObjc error while trying to deploy flask app on Heroku


I am trying to deploy my first web app on Heroku however I am getting a PyObjc error while pushing the code. I am doing this on a Mac Machine. This predictive application is developed using Flask. I do not know why this error is occurring as I do not have the PyObjc in my requirements.txt

alabaster==0.7.12
appdirs==1.4.4
applaunchservices==0.2.1
appnope==0.1.2
argon2-cffi==20.1.0
arrow==0.13.1
astroid==2.6.6
async-generator==1.10
atomicwrites==1.4.0
attrs==21.4.0
Babel==2.9.1
backcall==0.2.0
binaryornot==0.4.4
black==19.10b0
bleach==4.1.0
brotlipy==0.7.0
certifi==2021.10.8
cffi==1.15.0
chardet==4.0.0
charset-normalizer==2.0.4
click==8.0.3
cloudpickle==2.0.0
colorama==0.4.4
cryptography==36.0.0
cycler==0.11.0
debugpy==1.5.1
decorator==5.1.1
defusedxml==0.7.1
diff-match-patch==20200713
docutils==0.17.1
entrypoints==0.3
flake8==3.9.2
Flask==2.0.2
fonttools==4.29.1
idna==3.3
imagesize==1.3.0
importlib-metadata==4.8.2
inflection==0.5.1
intervaltree==3.1.0
ipykernel==6.4.1
ipython==7.31.1
ipython-genutils==0.2.0
isort==5.9.3
itsdangerous==2.0.1
jedi==0.18.1
Jinja2
jinja2-time==0.2.0
joblib==1.1.0
jsonify==0.5
jsonschema==3.2.0
jupyter-client==6.1.12
jupyter-core==4.9.1
jupyterlab-pygments==0.1.2
keyring==23.4.0
kiwisolver==1.3.2
lazy-object-proxy==1.6.0
MarkupSafe
matplotlib==3.5.1
matplotlib-inline==0.1.2
mccabe==0.6.1
mistune==0.8.4
mypy-extensions==0.4.3
nbclient==0.5.3
nbconvert==6.3.0
nbformat==5.1.3
nest-asyncio==1.5.1
notebook==6.4.6
numpy==1.22.2
numpydoc==1.2
packaging==21.3
pandas==1.4.0
pandocfilters==1.5.0
parso==0.8.3
pathspec==0.7.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.0.1
pip==21.2.4
pluggy==1.0.0
poyo==0.5.0
prometheus-client==0.13.1
prompt-toolkit==3.0.20
psutil==5.8.0
ptyprocess==0.7.0
pycparser==2.21
pydocstyle==6.1.1
pyflakes==2.3.1
Pygments==2.10.0
pylint==2.9.6
pyls-spyder==0.4.0
pyOpenSSL==22.0.0
pyparsing==3.0.4
pyrsistent==0.18.0
PySocks==1.7.1
python-dateutil==2.8.2
python-lsp-black==1.0.0
python-lsp-jsonrpc==1.0.0
python-lsp-server==1.2.4
python-slugify==5.0.2
pytz==2021.3
PyYAML==6.0
pyzmq==22.3.0
QDarkStyle==3.0.2
qstylizer==0.1.10
QtAwesome==1.0.3
qtconsole
QtPy==1.11.2
regex==2021.11.2
requests==2.27.1
rope==0.22.0
Rtree==0.9.7
scikit-learn==1.0.2
scipy==1.7.3
seaborn==0.11.2
Send2Trash==1.8.0
setuptools==58.0.4
six==1.16.0
sklearn==0.0
snowballstemmer==2.2.0
sortedcontainers==2.4.0
Sphinx==4.4.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
spyder==5.1.5
spyder-kernels==2.1.3
terminado==0.9.4
testpath==0.5.0
text-unidecode==1.3
textdistance==4.2.1
threadpoolctl==3.1.0
three-merge==0.1.1
tinycss==0.4
tornado==6.1
traitlets==5.1.1
typed-ast==1.4.3
typing-extensions==3.10.0.2
ujson==4.2.0
Unidecode==1.2.0
urllib3==1.26.8
watchdog==2.1.6
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==2.0.2
wheel==0.37.1
whichcraft==0.6.1
wrapt==1.12.1
wurlitzer==3.0.2
xgboost==1.5.2
yapf==0.31.0
zipp==3.7.0

The error I am getting is:

 ERROR: Cannot install applaunchservices because these package versions have conflicting dependencies.
       
       The conflict is caused by:
           pyobjc 8.2 depends on pyobjc-framework-AddressBook==8.2
           pyobjc 8.1 depends on pyobjc-framework-CoreData==8.1
           pyobjc 8.0 depends on pyobjc-framework-CoreAudio==8.0
           pyobjc 7.3 depends on pyobjc-core==7.3
           pyobjc 7.2 depends on pyobjc-framework-CoreAudioKit==7.2
           pyobjc 7.1 depends on pyobjc-framework-CoreMIDI==7.1
           pyobjc 7.0.1 depends on pyobjc-framework-CoreAudioKit==7.0.1
           pyobjc 7.0 depends on pyobjc-framework-ScreenSaver==7.0
           pyobjc 6.2.2 depends on pyobjc-core==6.2.2
           pyobjc 6.2.1 depends on pyobjc-framework-CoreServices==6.2.1
           pyobjc 6.2 depends on pyobjc-framework-Security==6.2
           pyobjc 6.1 depends on pyobjc-framework-AddressBook==6.1
           pyobjc 6.0.1 depends on pyobjc-framework-Cocoa==6.0.1
           pyobjc 6.0 depends on pyobjc-framework-Security==6.0
           pyobjc 5.3 depends on pyobjc-framework-SystemConfiguration==5.3
           pyobjc 5.2 depends on pyobjc-core==5.2
           pyobjc 5.1.2 depends on pyobjc-framework-CoreAudio==5.1.2
           pyobjc 5.1.1 depends on pyobjc-framework-Cocoa==5.1.1
           pyobjc 5.1 depends on pyobjc-framework-Cocoa==5.1
           pyobjc 5.0 depends on pyobjc-framework-WebKit==5.0
           pyobjc 4.2.2 depends on pyobjc-framework-Cocoa==4.2.2
           pyobjc 4.2.1 depends on pyobjc-framework-SystemConfiguration==4.2.1
           pyobjc 4.2 depends on pyobjc-framework-CoreText==4.2
           pyobjc 4.1 depends on pyobjc-framework-Cocoa==4.1
       
       To fix this you could try to:
       1. loosen the range of package versions you've specified
       2. remove package versions to allow pip attempt to solve the dependency conflict
       
       ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
 !     Push rejected, failed to compile Python app.
 !     Push failed

Solution

  • applaunchservices appears to be Apple-only:

    Simple package for registering an app with apple Launch Services to handle UTI and URL. See Apple documentations for details.

    I suspect you don't need that, either. Did you create your requirements.txt from a pip freeze? There's likely a bunch of stuff in there you don't need.

    I suggest you review that file and remove anything you aren't directly depending on. pip will find transitive dependencies (dependencies your dependencies depend on) and install them automatically.

    Prune that file, commit, and redeploy.