Reputation: 6954
I recently tried to upload a Flask application to AWS however I received an error stating:
Your requirements.txt is invalid. Snapshot your logs for details.
I uploaded a test application (which I found online) to the server which worked, however my own application does not.
This is what my requirements.txt files looks like:
awsebcli==3.4.5
blinker==1.3
cement==2.4.0
docker-py==1.1.0
dockerpty==0.3.4
docopt==0.6.2
Flask==0.10.1
Flask-Bcrypt==0.6.2
Flask-Mail==0.9.1
itsdangerous==0.24
Jinja2==2.7.3
jmespath==0.7.1
MarkupSafe==0.23
mercurial==3.2.4
pathspec==0.3.3
pbr==1.1.1
plyer==1.2.1
pycrypto==2.6.1
python-bcrypt==0.3.1
python-dateutil==2.4.2
PyYAML==3.11
requests==2.6.2
schedule==0.3.1
six==1.9.0
stevedore==1.5.0
texttable==0.8.3
virtualenv==12.0.4
virtualenv-clone==0.2.5
virtualenvwrapper==4.6.0
websocket-client==0.32.0
Werkzeug==0.10.1
wxPython-common==3.0.2.0
I have no idea what is wrong with it. I have not manually changed it or added anything strange. I only used pip freeze > requirements.txt
to build it.
How do I solve this issue? Thanks.
Edit
These are my system packages:
awsebcli (3.4.5)
blinker (1.3)
cement (2.4.0)
docker-py (1.1.0)
dockerpty (0.3.4)
docopt (0.6.2)
Flask (0.10.1)
Flask-Bcrypt (0.6.2)
Flask-Mail (0.9.1)
itsdangerous (0.24)
Jinja2 (2.7.3)
jmespath (0.7.1)
MarkupSafe (0.23)
mercurial (3.2.4)
pathspec (0.3.3)
pbr (1.1.1)
pip (6.0.3)
plyer (1.2.1)
pycrypto (2.6.1)
python-bcrypt (0.3.1)
python-dateutil (2.4.2)
PyYAML (3.11)
requests (2.6.2)
schedule (0.3.1)
setuptools (7.0)
six (1.9.0)
stevedore (1.5.0)
texttable (0.8.3)
virtualenv (12.0.4)
virtualenv-clone (0.2.5)
virtualenvwrapper (4.6.0)
websocket-client (0.32.0)
Werkzeug (0.10.1)
Upvotes: 2
Views: 425
Reputation: 121
There are a lot of system packages that are mentioned here. If you want to list only the files required for your project, then create a virtual environment using the command
virtualenv --no-site-packages virt
then use your virtual environment and manually install the required libraries for your python project using pip or pip3 install.
source virt/bin/activate // Use this to enter your virtual env
After that just use the code
pip3 freeze --local > requirements.txt
To save the requirements for uploading.
Upvotes: 0
Reputation: 4061
Just copy-pasted and installed the code.
wxPython-common doesn't seem to have that version available in pip.
Other than that, there doesn't seem to be any issue. Just make sure the requirements.txt file don't have any other characters at the beginning or end of the file
Upvotes: 1