Search code examples
pythonherokupipanacondarequirements.txt

Deployment in Heroku Fails Due to issue in requirements.txt


I am trying to deploy my flask app on heroku. I am using a Conda and i used the command "pip freeze> requirements.txt" to generate the requirements.txt file. But when i am pushing the code to heroku git, it keeps showing an requirements.txt error. Also i noticed my requirements.txt is a little bit strange. Please Help me to resolve the issue.

This is my Requirements.txt File:

argon2-cffi @ file:///D:/bld/argon2-cffi_1596630042503/work
attrs==19.3.0
backcall @ file:///home/conda/feedstock_root/build_artifacts/backcall_1592338393461/work
backports.functools-lru-cache==1.6.1
bleach @ file:///home/conda/feedstock_root/build_artifacts/bleach_1588608214987/work
brotlipy==0.7.0
certifi==2020.6.20
cffi @ file:///D:/bld/cffi_1595805794566/work
chardet==3.0.4
chart-studio==1.1.0
click==7.1.2
colorama==0.4.3
colorlover==0.3.0
cryptography @ file:///D:/bld/cryptography_1595349005639/work
cufflinks==0.17.3
dash @ file:///home/conda/feedstock_root/build_artifacts/dash_1596870105808/work
dash-core-components @ file:///home/conda/feedstock_root/build_artifacts/dash-core-components_1596203643601/work
dash-html-components==1.0.3
dash-renderer @ file:///home/conda/feedstock_root/build_artifacts/dash-renderer_1596203647496/work
dash-table @ file:///home/conda/feedstock_root/build_artifacts/dash-table_1596867885662/work
decorator==4.4.2
defusedxml==0.6.0
entrypoints==0.3
Flask==1.1.2
Flask-Compress==1.5.0
future==0.18.2
gunicorn==20.0.4
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1593328102638/work
importlib-metadata @ file:///D:/bld/importlib-metadata_1593211580034/work
ipykernel @ file:///D:/bld/ipykernel_1595447084845/work/dist/ipykernel-5.3.4-py3-none-any.whl
ipython @ file:///D:/bld/ipython_1596256504166/work
ipython-genutils==0.2.0
ipywidgets==7.5.1
itsdangerous==1.1.0
jedi==0.15.2
Jinja2==2.11.2
jsonschema==3.2.0
jupyter-client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1594732094290/work
jupyter-core==4.6.3
MarkupSafe==1.1.1
mistune==0.8.4
nbconvert==5.6.1
nbformat @ file:///home/conda/feedstock_root/build_artifacts/nbformat_1594060262917/work
notebook @ file:///D:/bld/notebook_1596502711596/work
numpy @ file:///D:/bld/numpy_1595523081734/work
packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1589925210001/work
pandas @ file:///D:/bld/pandas_1595958702229/work
pandocfilters==1.4.2
parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1596584577899/work
pickleshare==0.7.5
plotly==4.9.0
prometheus-client @ file:///home/conda/feedstock_root/build_artifacts/prometheus_client_1590412252446/work
prompt-toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1592500439797/work
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1593275161868/work
Pygments==2.6.1
pyOpenSSL==19.1.0
pyparsing==2.4.7
pyrsistent==0.16.0
PySocks==1.7.1
python-dateutil==2.8.1
pytz==2020.1
pywin32==227
pywinpty==0.5.7
PyYAML==5.3.1
pyzmq==19.0.2
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1592425495151/work
retrying==1.3.3
Send2Trash==1.5.0
six==1.15.0
terminado==0.8.3
testpath==0.4.4
tornado==6.0.4
traitlets==4.3.3
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1595434816409/work
wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1595859607677/work
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension @ file:///D:/bld/widgetsnbextension_1594164609360/work
win-inet-pton==1.1.0
wincertstore==0.2
zipp==3.1.0

Right now the error is being shown as:

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/D:/bld/argon2-cffi_1596630042503

Solution

  • I had the same issue deploying to heroku. Try:

    pip list --format=freeze > requirements.txt

    Found the answer here: https://github.com/pypa/pip/issues/8174