/usr/bin/ld: cannot find -lz












4















I'm trying to install lxml on a virtual machine running ubuntu/trusty64 in a virtualenv however i get this error below and can't get my head around it.



/usr/bin/ld: cannot find -lz


the first time this error occurred i looked into installing lz. i installed it using sudo apt-get install mtools which contains lz however the error still occurs therefore i'm thinking this could be a symbolic link problem maybe a file is supposed to be linked to lz but not sure what file. lz has a symlink to uz but i dont know what effect that has and don't want to change that incase it breaks something else. any ideas to point me in the right direction?



building 'lxml.etree' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/src

creating build/temp.linux-x86_64-2.7/src/lxml

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so

/usr/bin/ld: cannot find -lz

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /home/vagrant/.virtualenvs/devenv/bin/python -c "import setuptools, tokenize;__file__='/home/vagrant/.virtualenvs/devenv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-yUqdLy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/.virtualenvs/devenv/include/site/python2.7 failed with error code 1 in /home/vagrant/.virtualenvs/devenv/build/lxml
Storing debug log for failure in /home/vagrant/.pip/pip.log

(devenv)vagrant@vagrant-ubuntu-trusty-64:/vagrant/woowoo/woowoo_webapp$ ls -l /usr/bin/ld
lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
(devenv)$ vim /usr/bin/ld.bfd
(devenv)$ ls -l /usr/bin/ld.bfd
-rwxr-xr-x 1 root root 1050912 Sep 16 16:10 /usr/bin/ld.bfd
(devenv)$ ls -l /usr/bin/ld
lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
(devenv)$ ls -l /usr/bin/lzlrwxrwxrwx 1 root root 2 Oct 10 2013 /usr/bin/lz -> uz
(devenv)$ ls -l /usr/bin/uz
-rwxr-xr-x 1 root root 2496 Oct 10 2013 /usr/bin/uz









share|improve this question



























    4















    I'm trying to install lxml on a virtual machine running ubuntu/trusty64 in a virtualenv however i get this error below and can't get my head around it.



    /usr/bin/ld: cannot find -lz


    the first time this error occurred i looked into installing lz. i installed it using sudo apt-get install mtools which contains lz however the error still occurs therefore i'm thinking this could be a symbolic link problem maybe a file is supposed to be linked to lz but not sure what file. lz has a symlink to uz but i dont know what effect that has and don't want to change that incase it breaks something else. any ideas to point me in the right direction?



    building 'lxml.etree' extension

    creating build/temp.linux-x86_64-2.7

    creating build/temp.linux-x86_64-2.7/src

    creating build/temp.linux-x86_64-2.7/src/lxml

    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w

    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so

    /usr/bin/ld: cannot find -lz

    collect2: error: ld returned 1 exit status

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
    Cleaning up...
    Command /home/vagrant/.virtualenvs/devenv/bin/python -c "import setuptools, tokenize;__file__='/home/vagrant/.virtualenvs/devenv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-yUqdLy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/.virtualenvs/devenv/include/site/python2.7 failed with error code 1 in /home/vagrant/.virtualenvs/devenv/build/lxml
    Storing debug log for failure in /home/vagrant/.pip/pip.log

    (devenv)vagrant@vagrant-ubuntu-trusty-64:/vagrant/woowoo/woowoo_webapp$ ls -l /usr/bin/ld
    lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
    (devenv)$ vim /usr/bin/ld.bfd
    (devenv)$ ls -l /usr/bin/ld.bfd
    -rwxr-xr-x 1 root root 1050912 Sep 16 16:10 /usr/bin/ld.bfd
    (devenv)$ ls -l /usr/bin/ld
    lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
    (devenv)$ ls -l /usr/bin/lzlrwxrwxrwx 1 root root 2 Oct 10 2013 /usr/bin/lz -> uz
    (devenv)$ ls -l /usr/bin/uz
    -rwxr-xr-x 1 root root 2496 Oct 10 2013 /usr/bin/uz









    share|improve this question

























      4












      4








      4








      I'm trying to install lxml on a virtual machine running ubuntu/trusty64 in a virtualenv however i get this error below and can't get my head around it.



      /usr/bin/ld: cannot find -lz


      the first time this error occurred i looked into installing lz. i installed it using sudo apt-get install mtools which contains lz however the error still occurs therefore i'm thinking this could be a symbolic link problem maybe a file is supposed to be linked to lz but not sure what file. lz has a symlink to uz but i dont know what effect that has and don't want to change that incase it breaks something else. any ideas to point me in the right direction?



      building 'lxml.etree' extension

      creating build/temp.linux-x86_64-2.7

      creating build/temp.linux-x86_64-2.7/src

      creating build/temp.linux-x86_64-2.7/src/lxml

      x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w

      x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so

      /usr/bin/ld: cannot find -lz

      collect2: error: ld returned 1 exit status

      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

      ----------------------------------------
      Cleaning up...
      Command /home/vagrant/.virtualenvs/devenv/bin/python -c "import setuptools, tokenize;__file__='/home/vagrant/.virtualenvs/devenv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-yUqdLy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/.virtualenvs/devenv/include/site/python2.7 failed with error code 1 in /home/vagrant/.virtualenvs/devenv/build/lxml
      Storing debug log for failure in /home/vagrant/.pip/pip.log

      (devenv)vagrant@vagrant-ubuntu-trusty-64:/vagrant/woowoo/woowoo_webapp$ ls -l /usr/bin/ld
      lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
      (devenv)$ vim /usr/bin/ld.bfd
      (devenv)$ ls -l /usr/bin/ld.bfd
      -rwxr-xr-x 1 root root 1050912 Sep 16 16:10 /usr/bin/ld.bfd
      (devenv)$ ls -l /usr/bin/ld
      lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
      (devenv)$ ls -l /usr/bin/lzlrwxrwxrwx 1 root root 2 Oct 10 2013 /usr/bin/lz -> uz
      (devenv)$ ls -l /usr/bin/uz
      -rwxr-xr-x 1 root root 2496 Oct 10 2013 /usr/bin/uz









      share|improve this question














      I'm trying to install lxml on a virtual machine running ubuntu/trusty64 in a virtualenv however i get this error below and can't get my head around it.



      /usr/bin/ld: cannot find -lz


      the first time this error occurred i looked into installing lz. i installed it using sudo apt-get install mtools which contains lz however the error still occurs therefore i'm thinking this could be a symbolic link problem maybe a file is supposed to be linked to lz but not sure what file. lz has a symlink to uz but i dont know what effect that has and don't want to change that incase it breaks something else. any ideas to point me in the right direction?



      building 'lxml.etree' extension

      creating build/temp.linux-x86_64-2.7

      creating build/temp.linux-x86_64-2.7/src

      creating build/temp.linux-x86_64-2.7/src/lxml

      x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w

      x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so

      /usr/bin/ld: cannot find -lz

      collect2: error: ld returned 1 exit status

      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

      ----------------------------------------
      Cleaning up...
      Command /home/vagrant/.virtualenvs/devenv/bin/python -c "import setuptools, tokenize;__file__='/home/vagrant/.virtualenvs/devenv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-yUqdLy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/.virtualenvs/devenv/include/site/python2.7 failed with error code 1 in /home/vagrant/.virtualenvs/devenv/build/lxml
      Storing debug log for failure in /home/vagrant/.pip/pip.log

      (devenv)vagrant@vagrant-ubuntu-trusty-64:/vagrant/woowoo/woowoo_webapp$ ls -l /usr/bin/ld
      lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
      (devenv)$ vim /usr/bin/ld.bfd
      (devenv)$ ls -l /usr/bin/ld.bfd
      -rwxr-xr-x 1 root root 1050912 Sep 16 16:10 /usr/bin/ld.bfd
      (devenv)$ ls -l /usr/bin/ld
      lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
      (devenv)$ ls -l /usr/bin/lzlrwxrwxrwx 1 root root 2 Oct 10 2013 /usr/bin/lz -> uz
      (devenv)$ ls -l /usr/bin/uz
      -rwxr-xr-x 1 root root 2496 Oct 10 2013 /usr/bin/uz






      virtualbox






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 4 '16 at 21:16









      JoelJoel

      2314




      2314






















          2 Answers
          2






          active

          oldest

          votes


















          6














          You need to install the build dependencies of lxml in order to compile it. Try doing sudo apt-get build-dep python-lxml if you have source package data enabled in your apt sources.



          What is missing is not the lz command, but the development files for the zlib library. You need to install zlib1g-dev to get this.






          share|improve this answer



















          • 1





            perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

            – Joel
            Jan 4 '16 at 21:53



















          0














          Try one of those three :




          1. sudo apt-get install zlib1g-dev

          2. sudo apt-get install libz-dev

          3. sudo apt-get install lib32z1-dev


          wish will work for you
          reference to “/usr/bin/ld: cannot find -lz” for more details.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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',
            autoActivateHeartbeat: false,
            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%2faskubuntu.com%2fquestions%2f716945%2fusr-bin-ld-cannot-find-lz%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            6














            You need to install the build dependencies of lxml in order to compile it. Try doing sudo apt-get build-dep python-lxml if you have source package data enabled in your apt sources.



            What is missing is not the lz command, but the development files for the zlib library. You need to install zlib1g-dev to get this.






            share|improve this answer



















            • 1





              perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

              – Joel
              Jan 4 '16 at 21:53
















            6














            You need to install the build dependencies of lxml in order to compile it. Try doing sudo apt-get build-dep python-lxml if you have source package data enabled in your apt sources.



            What is missing is not the lz command, but the development files for the zlib library. You need to install zlib1g-dev to get this.






            share|improve this answer



















            • 1





              perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

              – Joel
              Jan 4 '16 at 21:53














            6












            6








            6







            You need to install the build dependencies of lxml in order to compile it. Try doing sudo apt-get build-dep python-lxml if you have source package data enabled in your apt sources.



            What is missing is not the lz command, but the development files for the zlib library. You need to install zlib1g-dev to get this.






            share|improve this answer













            You need to install the build dependencies of lxml in order to compile it. Try doing sudo apt-get build-dep python-lxml if you have source package data enabled in your apt sources.



            What is missing is not the lz command, but the development files for the zlib library. You need to install zlib1g-dev to get this.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 4 '16 at 21:21









            dobeydobey

            32.8k33686




            32.8k33686








            • 1





              perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

              – Joel
              Jan 4 '16 at 21:53














            • 1





              perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

              – Joel
              Jan 4 '16 at 21:53








            1




            1





            perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

            – Joel
            Jan 4 '16 at 21:53





            perfect that did the trick! i didn't know about building dependancies in order to compile but that makes perfect sense. thanks for teaching me something and solving my problem

            – Joel
            Jan 4 '16 at 21:53













            0














            Try one of those three :




            1. sudo apt-get install zlib1g-dev

            2. sudo apt-get install libz-dev

            3. sudo apt-get install lib32z1-dev


            wish will work for you
            reference to “/usr/bin/ld: cannot find -lz” for more details.






            share|improve this answer




























              0














              Try one of those three :




              1. sudo apt-get install zlib1g-dev

              2. sudo apt-get install libz-dev

              3. sudo apt-get install lib32z1-dev


              wish will work for you
              reference to “/usr/bin/ld: cannot find -lz” for more details.






              share|improve this answer


























                0












                0








                0







                Try one of those three :




                1. sudo apt-get install zlib1g-dev

                2. sudo apt-get install libz-dev

                3. sudo apt-get install lib32z1-dev


                wish will work for you
                reference to “/usr/bin/ld: cannot find -lz” for more details.






                share|improve this answer













                Try one of those three :




                1. sudo apt-get install zlib1g-dev

                2. sudo apt-get install libz-dev

                3. sudo apt-get install lib32z1-dev


                wish will work for you
                reference to “/usr/bin/ld: cannot find -lz” for more details.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 31 at 19:57









                DINA TAKLITDINA TAKLIT

                1034




                1034






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f716945%2fusr-bin-ld-cannot-find-lz%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

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    19世紀