3

I have flask application running on openshift and I am trying to import requests module in program. I have added dependencies in requirements.txt as stated here.

My requirements.txt contains following entries.

Flask==0.10.1
Requests=2.6.0

I got 500 : Internal Server Error and upon rhc tail i am getting

ImportError: No module named requests

Am i missing something ?

Update : There was mistake in requirements.txt it is == and not =.

Correct version of requirements.txt should look like this.

Flask==0.10.1
Requests==2.6.0

However i am still facing problem because on git push my log states.

remote: Could not find a version that satisfies the requirement Requests==2.6.0 (from -r /var/lib/openshift/xxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/requirements.txt (line 2)) (from versions: 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.6, 0.10.7, 0.10.8, 0.11.1, 0.11.2, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.13.8, 0.13.9, 0.14.0, 0.14.1, 0.14.2, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1) remote: Cleaning up...

Alternate Solution: You can SSH your application and can manually install package using pip as answered in this thread.

Community
  • 1
  • 1
Harikesh
  • 313
  • 3
  • 14

1 Answers1

2

You should put two equal signs:

Flask==0.10.1
Requests==2.5.1

or

Requests>=2.5.1

or, as @Paco suggested,

Requests 

Note: This is generally a bad idea to add a package without the release number. If a newer version is released and that release breaks compatibility, next time you run (directly or when building the project), it might break everything.

Paco
  • 4,520
  • 3
  • 29
  • 53
doru
  • 9,022
  • 2
  • 33
  • 43
  • on git push log is saying remote: Could not find a version that satisfies the requirement (line 2)) (from versions: 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.6, 0.10.7, 0.10.8, 0.11.1, 0.11.2, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.13.8, 0.13.9, 0.14.0, .... – Harikesh Apr 25 '15 at 11:18
  • 0.14.1, 0.14.2, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1) – Harikesh Apr 25 '15 at 11:20
  • Then use the last one availaable: `2.5.1` – doru Apr 25 '15 at 11:22
  • 1
    you could also remove the `==2.6.0` part. It will download the latest version available. It is better to have version numbers, in case a release breaks backwards compatibility, but if you just need to do this once, you can do it. – Paco Apr 25 '15 at 11:25
  • I did ssh my app and manually installed requests through pip. – Harikesh Apr 25 '15 at 11:31