2

I have an issue while trying to deploy my Django app to Heroku.

It complains about issues with installing facebook-sdk library, but actually there is no such thing in the requirements.txt file.

I already tried pushing with -f flag, I commented out lines from requirements.txt. I've even pushed an empty requirements file and the issues still persist.

I have no idea if there is any way to reset the app or heroku's repo beside creating a new one? Any ideas what I could try?

Console log:

$ git push prod master
Counting objects: 52282, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (17957/17957), done.
Writing objects: 100% (52282/52282), 138.01 MiB | 137 KiB/s, done.
Total 52282 (delta 33410), reused 48501 (delta 30768)

-----> Heroku receiving push
-----> Python/Django app detected
-----> Preparing Python interpreter (2.7.2)
-----> Creating Virtualenv version 1.7
       New python executable in .heroku/venv/bin/python2.7
       Also creating executable in .heroku/venv/bin/python
       Installing distribute.............................................................................................................................................................................................done.
       Installing pip...............done.
       Running virtualenv with interpreter /usr/local/bin/python2.7
-----> Activating virtualenv
-----> Installing dependencies using pip version 1.0.2
error: The requested URL returned error: 401 while accessing http://github.com/facebook/python-sdk.git/info/refs

fatal: HTTP request failed
       Downloading/unpacking paramiko (from -r requirements.txt (line 17))
       Creating supposed download cache at /app/tmp/repo.git/.cache/pip_downloads
         Storing download in cache at /app/tmp/repo.git/.cache/pip_downloads/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fp%2Fparamiko%2Fparamiko-1.7.7.2.zip
         Running setup.py egg_info for package paramiko

       Obtaining facebook-sdk from git+http://github.com/facebook/python-sdk.git#egg=facebook-sdk (from -r requirements.txt (line 23))
         Cloning http://github.com/facebook/python-sdk.git to ./.heroku/src/facebook-sdk
         Complete output from command /usr/bin/git clone -q http://github.com/facebook/python-sdk.git /tmp/build_1bn5oykhrmms7/.heroku/src/facebook-sdk:

       ----------------------------------------
       Command /usr/bin/git clone -q http://github.com/facebook/python-sdk.git /tmp/build_1bn5oykhrmms7/.heroku/src/facebook-sdk failed with error code 128
       Storing complete log in /app/.pip/pip.log
 !     Heroku push rejected, failed to compile Python/django app
bx2
  • 6,356
  • 5
  • 36
  • 40

3 Answers3

3

The right solution is "Maxime R."'s solution on how to pip uninstall with virtualenv on heroku cedar stack?

heroku labs:enable user_env_compile heroku config:add CLEAN_VIRTUALENV=true

Currently this won't work because there is a bug. You'll need to use my fork of the buildpack until this get fixed upstream :

heroku config:add BUILDPACK_URL=git@github.com:blaze33/heroku-buildpack-python.git

Now push your new code and you'll notice that the whole virtualenv gets reinstalled.

Andrey's answer no longer works since March 23 2012. The new style virtualenv commit moved the virtual env from /app to /app/.heroku/venv but the purge branch wasn't updated to catch up so that you end up with a virtualenv not being in PYTHONHOME.

After several attempts with heroku run command finally I applied Maxime R. solution successfully. Also I have been opened a Heroku ticket and Heroku support has been confirmed to me that this is the solution.

Community
  • 1
  • 1
dani herrera
  • 48,760
  • 8
  • 117
  • 177
0

It's happen because you're using an empty repository for python-SDK's library (http://github.com/facebook/python-sdk.git), try using another repo: https://github.com/pythonforfacebook/facebook-sdk

panjianom
  • 236
  • 4
  • 18
0

I had removed two packages from the virtual env and requirements.txt, and temporarily changing the Python runtime (as suggested here) is the only approach I found that allowed me to uninstall those packages from heroku.

Community
  • 1
  • 1