goryef
goryef

Reputation: 1489

heroku/python buildpack for node.js app get rejected

I have an Node.js app with Python scripts that I am trying to deploy to Heroku.

Every time I try to add the heroku/python buildpack the git push gets rejected.

remote: Could not find a version that satisfies the requirement pywin32==224 (from -r /tmp/build_ebad00f3b8d3c9b4b03965f0d0924e7a/requirements.txt (line 57)) (from versions: ) remote: No matching distribution found for pywin32==224 (from -r /tmp/build_ebad00f3b8d3c9b4b03965f0d0924e7a/requirements.txt (line 57))

remote: ! Push rejected, failed to compile Python app.

remote:

remote: ! Push failed

remote: ! Push failed

remote: Verifying deploy...

remote: remote: ! Push rejected to XXXXXX

remote:

To https://git.heroku.com/xxxxxx.git

! [remote rejected] master -> master (pre-receive hook declined)

error: failed to push some refs to 'https://git.heroku.com/xxxxx.git'

Without the heroku/python buildpack the push works fine. I think I need that buildback for my Python scripts work on web.

My app runs fine locally but everything related to Python is not working when deployed. I use Python 3.7.3 64-bit version. I have runtime.txt and requirements.txt in root of my app.

My runtime.txt file:

python-3.7.3

requirements.txt:

        altgraph==0.16.1
        asn1crypto==0.24.0
        astroid==2.1.0
        awscli==1.16.209
        beautifulsoup4==4.6.3
        botocore==1.12.199
        bs4==0.0.1
        cached-property==1.5.1
        cachetools==3.1.1
        certifi==2019.6.16
        cffi==1.12.2
        chardet==3.0.4
        colorama==0.3.9
        cryptography==2.6.1
        defusedxml==0.5.0
        dnspython==1.16.0
        docutils==0.14
        et-xmlfile==1.0.1
        exchangelib==1.12.2
        future==0.17.1
        google-api-python-client==1.7.9
        google-auth==1.6.3
        google-auth-httplib2==0.0.3
        google-auth-oauthlib==0.4.0
        googletrans==2.4.0
        gspread==3.1.0
        httplib2==0.13.0
        idna==2.8
        isodate==0.6.0
        isort==4.3.4
        jdcal==1.4
        jmespath==0.9.4
        lazy-object-proxy==1.3.1
        lxml==4.3.2
        macholib==1.11
        mccabe==0.6.1
        ntlm-auth==1.2.0
        numpy==1.15.4
        oauth2client==4.1.3
        oauthlib==3.0.1
        openpyxl==2.6.0
        pandas==0.23.4
        pefile==2018.8.8
        py2exe==0.9.2.2
        pyasn1==0.4.5
        pyasn1-modules==0.2.5
        pycparser==2.19
        Pygments==2.3.1
        pygsheets==2.0.1
        PyInstaller==3.4
        pylint==2.2.2
        PyMySQL==0.9.3
        pyodbc==4.0.26
        PySocks==1.6.8
        python-dateutil==2.7.5
        pytz==2019.1
        pywin32==224
        pywin32-ctypes==0.2.0
        pywinrm==0.3.0
        PyYAML==5.1
        requests==2.22.0
        requests-kerberos==0.12.0
        requests-ntlm==1.1.0
        requests-oauthlib==1.2.0
        rsa==3.4.2
        s3transfer==0.2.1
        selenium==3.141.0
        six==1.11.0
        soupsieve==1.8
        stem==1.7.0
        torrequest==0.1.0
        tzlocal==1.5.1
        uritemplate==3.0.0
        urllib3==1.25.3
        uuid==1.30
        virtualenv==16.7.2
        winkerberos==0.7.0
        wrapt==1.10.11
        xlrd==1.1.0
        XlsxWriter==1.1.2
        xmltodict==0.12.0

Appreciate any guidance.

Upvotes: 0

Views: 384

Answers (1)

Chris
Chris

Reputation: 136958

Here's the problem:

Could not find a version that satisfies the requirement pywin32==224

Heroku doesn't run Windows, so pywin32 isn't available. I'm not sure what you're using that for. If you don't need it, remove it (along with pywin32-ctypes, pywinrm, and anything else that's Windows-dependent) then redeploy. If you're using those libraries you'll need to rewrite that portion of your code.

Generally speaking, your requirements.txt should only have things your application actually needs. I suspect that you've got a lot of things in there that you're not using. Maybe you're not using virtual environments?

Upvotes: 1

Related Questions