2

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)
1
  • There are a lot of packages in here that you probably don't need for your app. You probably should clean up this file so it only contains what you know you need. Just to list a few (possible) offenders: awsebcli, botocore, setuptools, cement, mercurial, pip, pathspec... Commented Jul 1, 2015 at 16:44

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

7 Comments

I don't remember installing wxPython in my Virtualenv. I just tried to uninstall it but I get an OSError telling me I have no permission to do this.
Is it installed on your system? It probably is and you are probably using site-packages too in your virtualenv
It is installed on my system. I was under the impression that a virtualenv would not include these packages? How would I go about uninstalling it then due to the OSError?
You can use sudo to uninstall it. Better to create a proper virtualenv that doesn't use your system packages. Then install the requirements that are required and then use that.
Thanks I just uninstalled wxpython. I created a new virtualenv but there are still the system packages installed. I tried using --no-site-packages too and still they are installed.
|
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.