geoDjango on heroku









up vote
1
down vote

favorite












I'm using heroku to develop a django backend. I would like to enable geoDjango to use spatial feature with my models.
I followed all the steps that are describe on the django and heroku docs but I'm still getting an error when I want to run manage.py migrate or other request and command on the server:



OSError: /app/.heroku/vendor/lib: cannot open shared object file: No such file or directory


I did check with bash if it was true and yes there no lib directory in my vendor. I don't know a lot about buildpacks and config on heroku so I don't know where to start to fix this error.
Here is my buildspack:



  1. https://github.com/cyberdelia/heroku-geo-buildpack.git

  2. heroku/python

And in my .buildpacks I tried to put:



https://github.com/cyberdelia/heroku-geo-buildpack.git#e1b845b
https://github.com/heroku/heroku-buildpack-python.git


I also tried different forks that were not able to build at all...



I did put the paths in my settings:



GEOS_LIBRARY_PATH = os.environ.get('GEOS_LIBRARY_PATH')
GDAL_LIBRARY_PATH = os.environ.get('GDAL_LIBRARY_PATH')


I'm a bit lost so help would be greatly appreciated



EDIT:
So I tried to downgrade my stack to heroku-16 (it was heroku-18) and it build but when I want to migrate it show me a new error message:



OSError: /app/.heroku/vendor/lib: cannot read file data: Is a directory


And when I try to follow this tutorial I can't even build and get this:



-----> geos/gdal/proj app detected
Using geos version: <?xml version="1.0" encoding="UTF-8"?>
Using gdal version: <?xml version="1.0" encoding="UTF-8"?>
Using proj version: <?xml version="1.0" encoding="UTF-8"?>
/app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 82: [: too many arguments
/app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 88: [: too many arguments
/app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 94: [: too many arguments
cp: target '/tmp/build_a7cfd7a56646fe632a93fc752b8ee03d/.heroku/vendor/lib/.' is not a directory
! Push rejected, failed to compile geos/gdal/proj app.
! Push failed









share|improve this question



























    up vote
    1
    down vote

    favorite












    I'm using heroku to develop a django backend. I would like to enable geoDjango to use spatial feature with my models.
    I followed all the steps that are describe on the django and heroku docs but I'm still getting an error when I want to run manage.py migrate or other request and command on the server:



    OSError: /app/.heroku/vendor/lib: cannot open shared object file: No such file or directory


    I did check with bash if it was true and yes there no lib directory in my vendor. I don't know a lot about buildpacks and config on heroku so I don't know where to start to fix this error.
    Here is my buildspack:



    1. https://github.com/cyberdelia/heroku-geo-buildpack.git

    2. heroku/python

    And in my .buildpacks I tried to put:



    https://github.com/cyberdelia/heroku-geo-buildpack.git#e1b845b
    https://github.com/heroku/heroku-buildpack-python.git


    I also tried different forks that were not able to build at all...



    I did put the paths in my settings:



    GEOS_LIBRARY_PATH = os.environ.get('GEOS_LIBRARY_PATH')
    GDAL_LIBRARY_PATH = os.environ.get('GDAL_LIBRARY_PATH')


    I'm a bit lost so help would be greatly appreciated



    EDIT:
    So I tried to downgrade my stack to heroku-16 (it was heroku-18) and it build but when I want to migrate it show me a new error message:



    OSError: /app/.heroku/vendor/lib: cannot read file data: Is a directory


    And when I try to follow this tutorial I can't even build and get this:



    -----> geos/gdal/proj app detected
    Using geos version: <?xml version="1.0" encoding="UTF-8"?>
    Using gdal version: <?xml version="1.0" encoding="UTF-8"?>
    Using proj version: <?xml version="1.0" encoding="UTF-8"?>
    /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 82: [: too many arguments
    /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 88: [: too many arguments
    /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 94: [: too many arguments
    cp: target '/tmp/build_a7cfd7a56646fe632a93fc752b8ee03d/.heroku/vendor/lib/.' is not a directory
    ! Push rejected, failed to compile geos/gdal/proj app.
    ! Push failed









    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm using heroku to develop a django backend. I would like to enable geoDjango to use spatial feature with my models.
      I followed all the steps that are describe on the django and heroku docs but I'm still getting an error when I want to run manage.py migrate or other request and command on the server:



      OSError: /app/.heroku/vendor/lib: cannot open shared object file: No such file or directory


      I did check with bash if it was true and yes there no lib directory in my vendor. I don't know a lot about buildpacks and config on heroku so I don't know where to start to fix this error.
      Here is my buildspack:



      1. https://github.com/cyberdelia/heroku-geo-buildpack.git

      2. heroku/python

      And in my .buildpacks I tried to put:



      https://github.com/cyberdelia/heroku-geo-buildpack.git#e1b845b
      https://github.com/heroku/heroku-buildpack-python.git


      I also tried different forks that were not able to build at all...



      I did put the paths in my settings:



      GEOS_LIBRARY_PATH = os.environ.get('GEOS_LIBRARY_PATH')
      GDAL_LIBRARY_PATH = os.environ.get('GDAL_LIBRARY_PATH')


      I'm a bit lost so help would be greatly appreciated



      EDIT:
      So I tried to downgrade my stack to heroku-16 (it was heroku-18) and it build but when I want to migrate it show me a new error message:



      OSError: /app/.heroku/vendor/lib: cannot read file data: Is a directory


      And when I try to follow this tutorial I can't even build and get this:



      -----> geos/gdal/proj app detected
      Using geos version: <?xml version="1.0" encoding="UTF-8"?>
      Using gdal version: <?xml version="1.0" encoding="UTF-8"?>
      Using proj version: <?xml version="1.0" encoding="UTF-8"?>
      /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 82: [: too many arguments
      /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 88: [: too many arguments
      /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 94: [: too many arguments
      cp: target '/tmp/build_a7cfd7a56646fe632a93fc752b8ee03d/.heroku/vendor/lib/.' is not a directory
      ! Push rejected, failed to compile geos/gdal/proj app.
      ! Push failed









      share|improve this question















      I'm using heroku to develop a django backend. I would like to enable geoDjango to use spatial feature with my models.
      I followed all the steps that are describe on the django and heroku docs but I'm still getting an error when I want to run manage.py migrate or other request and command on the server:



      OSError: /app/.heroku/vendor/lib: cannot open shared object file: No such file or directory


      I did check with bash if it was true and yes there no lib directory in my vendor. I don't know a lot about buildpacks and config on heroku so I don't know where to start to fix this error.
      Here is my buildspack:



      1. https://github.com/cyberdelia/heroku-geo-buildpack.git

      2. heroku/python

      And in my .buildpacks I tried to put:



      https://github.com/cyberdelia/heroku-geo-buildpack.git#e1b845b
      https://github.com/heroku/heroku-buildpack-python.git


      I also tried different forks that were not able to build at all...



      I did put the paths in my settings:



      GEOS_LIBRARY_PATH = os.environ.get('GEOS_LIBRARY_PATH')
      GDAL_LIBRARY_PATH = os.environ.get('GDAL_LIBRARY_PATH')


      I'm a bit lost so help would be greatly appreciated



      EDIT:
      So I tried to downgrade my stack to heroku-16 (it was heroku-18) and it build but when I want to migrate it show me a new error message:



      OSError: /app/.heroku/vendor/lib: cannot read file data: Is a directory


      And when I try to follow this tutorial I can't even build and get this:



      -----> geos/gdal/proj app detected
      Using geos version: <?xml version="1.0" encoding="UTF-8"?>
      Using gdal version: <?xml version="1.0" encoding="UTF-8"?>
      Using proj version: <?xml version="1.0" encoding="UTF-8"?>
      /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 82: [: too many arguments
      /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 88: [: too many arguments
      /app/tmp/buildpacks/3174f4234c5151450fcaba5f50a050126498959c8209a7a6057230bfb29be2eaef3ae0098ab726ef807728f7b4792e31db50a2b89636ae181d9e71b03f2f83c1/bin/compile: line 94: [: too many arguments
      cp: target '/tmp/build_a7cfd7a56646fe632a93fc752b8ee03d/.heroku/vendor/lib/.' is not a directory
      ! Push rejected, failed to compile geos/gdal/proj app.
      ! Push failed






      django heroku gdal geodjango geos






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 at 10:10

























      asked Nov 11 at 16:27









      Colin Jean-Saunier

      215




      215






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          So I finally managed to find a solution, I had setup two variable in my settings.py as it was said in different tutorial and on the official doc:



          GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
          GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')


          But I don't know why those variable happend to be:



          /app/.heroku/vendor/lib


          And that's why it didn't work, so my solution is just to hardcode my paths for heroku:



          GEOS_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgeos_c.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GEOS_LIBRARY_PATH')
          GDAL_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgdal.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GDAL_LIBRARY_PATH')


          Be careful, you really need to put the "_c" to "libgeos_c.so" otherwise it's not working.



          I hope it helps






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250766%2fgeodjango-on-heroku%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            So I finally managed to find a solution, I had setup two variable in my settings.py as it was said in different tutorial and on the official doc:



            GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
            GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')


            But I don't know why those variable happend to be:



            /app/.heroku/vendor/lib


            And that's why it didn't work, so my solution is just to hardcode my paths for heroku:



            GEOS_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgeos_c.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GEOS_LIBRARY_PATH')
            GDAL_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgdal.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GDAL_LIBRARY_PATH')


            Be careful, you really need to put the "_c" to "libgeos_c.so" otherwise it's not working.



            I hope it helps






            share|improve this answer
























              up vote
              0
              down vote



              accepted










              So I finally managed to find a solution, I had setup two variable in my settings.py as it was said in different tutorial and on the official doc:



              GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
              GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')


              But I don't know why those variable happend to be:



              /app/.heroku/vendor/lib


              And that's why it didn't work, so my solution is just to hardcode my paths for heroku:



              GEOS_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgeos_c.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GEOS_LIBRARY_PATH')
              GDAL_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgdal.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GDAL_LIBRARY_PATH')


              Be careful, you really need to put the "_c" to "libgeos_c.so" otherwise it's not working.



              I hope it helps






              share|improve this answer






















                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                So I finally managed to find a solution, I had setup two variable in my settings.py as it was said in different tutorial and on the official doc:



                GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
                GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')


                But I don't know why those variable happend to be:



                /app/.heroku/vendor/lib


                And that's why it didn't work, so my solution is just to hardcode my paths for heroku:



                GEOS_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgeos_c.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GEOS_LIBRARY_PATH')
                GDAL_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgdal.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GDAL_LIBRARY_PATH')


                Be careful, you really need to put the "_c" to "libgeos_c.so" otherwise it's not working.



                I hope it helps






                share|improve this answer












                So I finally managed to find a solution, I had setup two variable in my settings.py as it was said in different tutorial and on the official doc:



                GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
                GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')


                But I don't know why those variable happend to be:



                /app/.heroku/vendor/lib


                And that's why it didn't work, so my solution is just to hardcode my paths for heroku:



                GEOS_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgeos_c.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GEOS_LIBRARY_PATH')
                GDAL_LIBRARY_PATH = '/app/.heroku/vendor/lib/libgdal.so' if os.environ.get('ENV') == 'HEROKU' else os.getenv('GDAL_LIBRARY_PATH')


                Be careful, you really need to put the "_c" to "libgeos_c.so" otherwise it's not working.



                I hope it helps







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 13 at 16:08









                Colin Jean-Saunier

                215




                215



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250766%2fgeodjango-on-heroku%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    ReactJS Fetched API data displays live - need Data displayed static

                    政党