4

I am building my own flask-oauth in my app's src/lib and adding it to the web application's path via: sys.path.insert(0, os.getcwd() + '/src/lib/flask-oauth') I have to do this because the pypi package doesn't have support for access_token_params, which google requires.

flask-oauth does not appear in requirements.txt currently, but it did in the past. As a result, it remains in my heroku app's vitualenv and I cannot get rid of it. My app works locally, but on heroku it dies with:

TypeError: __init__() got an unexpected keyword argument 'access_token_params'

I have tried listing the latest github version of flask-oauth in my requirements.txt file as in: git+git://github.com/mitsuhiko/flask-oauth.git, and the package does install. However, the application still loads the stale version from /app/.heroku/venv/lib/python2.7/site-packages/flaskext/oauth.py and the app still dies.

I have this in my requirements.txt:

-e git://github.com/mitsuhiko/flask-oauth.git@80167c44abc3df37e43a45474d19452065430464#egg=Flask_OAuth-dev

And the correct, latest, github version of flask-oauth now installs locally and works. But I still can't get heroku to acknowledge or use that package in the app. It uses their old version in /app/.heroku/venv/lib/python2.7/site-packages/flaskext/oauth.py

How can I clear heroku's virtualenv of this stale package? How can I make it use the github version and not its cached package?

Note: I have created a new app called mythin-dev, and it reads my requirements.txt and installs the correct version of flask-oauth from

-e git://github.com/mitsuhiko/flask-oauth.git@80167c44abc3df37e43a45474d19452065430464#egg=Flask_OAuth

So it seems that the problem is definitely the cached packages in my heroku virtualenv. Help, my application will not run on heroku until this is resolved :(

Jeff Tratner
  • 16,270
  • 4
  • 47
  • 67
rjurney
  • 4,824
  • 5
  • 41
  • 62

1 Answers1

3

Install this (https://github.com/lstoll/heroku-repo) Plugin and run heroku repo:purge_cache -a appname.

Eric Fode
  • 3,667
  • 2
  • 24
  • 29