I am trying to push my app to Heroku. Recently, I added requirements.txt with all packages needed but, I run into a problem while pushing into my Heroku account. What I understood is that when the server is trying to install my packages remotely, it is looking into the wrong directory. This is an image of the problem:

enter image description here

All my packages are already installed in /opt/ros/kinetic/lib/python2.7/dist-packages directory.

How can I modify the requirements.txt to look in that directory? I am a newly user of Heroku and I am stuck at this problem for a lot of time now.

1 Answers

0
Chris On

All my packages are already installed in /opt/ros/kinetic/lib/python2.7/dist-packages directory.

This is irrelevant. Note that the /tmp/build_foo/ directory Heroku references is local to Heroku's build environment, not your machine.

git push won't include your dependencies (unless you're tracking them, which you probably shouldn't be doing) and Heroku has no way to use them. Even if it could, it probably wouldn't as there's no guarantee that your packages will be binary compatible with Heroku (e.g. based on differences between your operating system or CPU architecture and Heroku's).

All of your dependencies should be listed in your requirements.txt, and Heroku will try to install them itself. Dependencies that are available via PyPI should work out of the box, but if you're using anything from another source you may need to be more specific.

Note that if your requirements.txt can't be used to resolve a complete set of dependencies for your application in a clean environment it's probably not correct. The whole point of this file is to define dependencies without having to also carry around a copy of each library.

I suspect that you should be including roslibpy, not actionlib, in your requirements.txt file.