2

I "finished" a little python project and I want to deploy it on heroku GitHub page. I want to execute: python2 main.py -i json-rpc in order to have the json-rpc server listening for connections but I get the following error when pushing to heroku:

$ git push heroku master Counting objects: 153, done. Delta compression using up to 8 threads. Compressing objects: 100% (87/87), done. Writing objects: 100% (153/153), 43.42 KiB, done. Total 153 (delta 61), reused 153 (delta 61)

-----> Heroku receiving push ! Heroku push rejected, no Cedar-supported app detected

To [email protected]:panager.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:panager.git'

7
  • 1
    Did you remember to actually create a Heroku app to push to? (Either on the heroku site, but preferably through the command line.) If not, go to the main folder of your project, and run the heroku toolbelt command heroku create, and then try git push heroku master. Commented Oct 17, 2012 at 19:54
  • FYI, you're also missing the requirements.txt necessary for Heroku to install Python dependencies you might need. Have you read Getting Started with Python on Heroku? Commented Oct 17, 2012 at 19:56
  • yes I did. I destroied and recreated the app several times... no luck... Commented Oct 17, 2012 at 19:56
  • i do not have any requirements. all the functions that i use are standard.take a look: github.com/ttouch/panager Commented Oct 17, 2012 at 19:57
  • Also, it looks like you're missing a virtualenv, since I don't see one on Github and there's no .gitignore to ignore it. virtualenvs are requirements for Python apps on Heroku. Commented Oct 17, 2012 at 19:59

2 Answers 2

14

What you might want to try doing is creating a Procfile. The full filename is Procfile, no extension, and it goes in the main directory of your project folder.

The content of that file would be:

web: python main.py -i json-rpc

Give that a shot and see if it works.

Alternatively, you may have forgotten to create a virtualenv for your app.

You should follow the instructions in Heroku's guide Getting Started with Python on Heroku

Update:

Having finally tested this myself on a fresh Heroku app, what you're missing is a requirements.txt. Even though you don't have any dependencies, you still need it. Within your virtualenv in the main project folder, run pip freeze > requirements.txt, and then git add . then git commit -m "added requirements.txt", and then push to Heroku and it should work.

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

2 Comments

see updated answer. you needed the virtualenv, and the Procfile, and the requirements.txt. You can't just leave out pieces from the tutorial.
I was able to launch with just Procfile and requirements.txt. No need for virtualenv. Thanks for this answer!
1

Also, make sure that requirements.txt is saved with ANSI encoding, not Unicode or UTF-8! If you're a total n00b like me you can simply open requirements.txt in Notepad, choose SAVE AS and change the "Encoding" from the drop down. I tried all of the recommendations above but my error was due to this simple encoding problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.