`python3.7: bad interpreter: No such file or directory`











up vote
0
down vote

favorite












I installed Python, pip3, and virtualenv as in this guide for TensorFlow:



brew install python
pip3 install -U virtualenv


Then I was able to create a virtual environment with:



virtualenv --system-site-packages -p python3 ./venv


Then I tried installing TensorFlow with



pip install --upgrade tensorflow


but it failed because TensorFlow is not yet compatible with Python 3.7. So I removed Python 3.7 with brew remove python and installed 3.6.7 from an installer. But running the same virtualenv command now fails:



$ virtualenv --system-site-packages -p python3 ./venv
-bash: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3


So the virtualenv link to the executable lists the newest Python version, even after removal.



Furthermore, virtualenv lists brew as the user group, which is also confusing:



$ ls -la /usr/local/bin/virtualenv
-rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv


I've tried uninstalling virtualenv with both pip and pip3 and I get:



Skipping virtualenv as it is not installed.


How can I fix this issue?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I installed Python, pip3, and virtualenv as in this guide for TensorFlow:



    brew install python
    pip3 install -U virtualenv


    Then I was able to create a virtual environment with:



    virtualenv --system-site-packages -p python3 ./venv


    Then I tried installing TensorFlow with



    pip install --upgrade tensorflow


    but it failed because TensorFlow is not yet compatible with Python 3.7. So I removed Python 3.7 with brew remove python and installed 3.6.7 from an installer. But running the same virtualenv command now fails:



    $ virtualenv --system-site-packages -p python3 ./venv
    -bash: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
    $ which python3
    /Library/Frameworks/Python.framework/Versions/3.6/bin/python3


    So the virtualenv link to the executable lists the newest Python version, even after removal.



    Furthermore, virtualenv lists brew as the user group, which is also confusing:



    $ ls -la /usr/local/bin/virtualenv
    -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv


    I've tried uninstalling virtualenv with both pip and pip3 and I get:



    Skipping virtualenv as it is not installed.


    How can I fix this issue?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I installed Python, pip3, and virtualenv as in this guide for TensorFlow:



      brew install python
      pip3 install -U virtualenv


      Then I was able to create a virtual environment with:



      virtualenv --system-site-packages -p python3 ./venv


      Then I tried installing TensorFlow with



      pip install --upgrade tensorflow


      but it failed because TensorFlow is not yet compatible with Python 3.7. So I removed Python 3.7 with brew remove python and installed 3.6.7 from an installer. But running the same virtualenv command now fails:



      $ virtualenv --system-site-packages -p python3 ./venv
      -bash: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
      $ which python3
      /Library/Frameworks/Python.framework/Versions/3.6/bin/python3


      So the virtualenv link to the executable lists the newest Python version, even after removal.



      Furthermore, virtualenv lists brew as the user group, which is also confusing:



      $ ls -la /usr/local/bin/virtualenv
      -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv


      I've tried uninstalling virtualenv with both pip and pip3 and I get:



      Skipping virtualenv as it is not installed.


      How can I fix this issue?










      share|improve this question













      I installed Python, pip3, and virtualenv as in this guide for TensorFlow:



      brew install python
      pip3 install -U virtualenv


      Then I was able to create a virtual environment with:



      virtualenv --system-site-packages -p python3 ./venv


      Then I tried installing TensorFlow with



      pip install --upgrade tensorflow


      but it failed because TensorFlow is not yet compatible with Python 3.7. So I removed Python 3.7 with brew remove python and installed 3.6.7 from an installer. But running the same virtualenv command now fails:



      $ virtualenv --system-site-packages -p python3 ./venv
      -bash: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
      $ which python3
      /Library/Frameworks/Python.framework/Versions/3.6/bin/python3


      So the virtualenv link to the executable lists the newest Python version, even after removal.



      Furthermore, virtualenv lists brew as the user group, which is also confusing:



      $ ls -la /usr/local/bin/virtualenv
      -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv


      I've tried uninstalling virtualenv with both pip and pip3 and I get:



      Skipping virtualenv as it is not installed.


      How can I fix this issue?







      virtualenv






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 3 at 15:02









      mmorin

      2118




      2118






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          After a few hours, one solution was to install virtualenv again with pip, then remove it with pip:



          $ ls -la /usr/local/bin/virtualenv
          -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv
          $ pip install virtualenv
          ...
          $ pip uninstall virtualenv
          ...
          $ which virtualenv
          $ ls -la /usr/local/bin/virtualenv
          ls: /usr/local/bin/virtualenv: No such file or directory


          And then install it again with pip3:



          $ pip3 install virtualenv
          Collecting virtualenv
          ...
          Installing collected packages: virtualenv
          Successfully installed virtualenv-16.1.0


          Notice the use of pip3, and not pip, unlike this link, pointed to by TensorFlow.



          And now creating the virtual environment works:



          $ virtualenv --system-site-packages -p python3 ./venv
          Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
          Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
          New python executable in ~/venv/bin/python3
          Also creating executable in ~/venv/bin/python
          Installing setuptools, pip, wheel...
          done.





          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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%2fsuperuser.com%2fquestions%2f1380418%2fpython3-7-bad-interpreter-no-such-file-or-directory%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
            1
            down vote













            After a few hours, one solution was to install virtualenv again with pip, then remove it with pip:



            $ ls -la /usr/local/bin/virtualenv
            -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv
            $ pip install virtualenv
            ...
            $ pip uninstall virtualenv
            ...
            $ which virtualenv
            $ ls -la /usr/local/bin/virtualenv
            ls: /usr/local/bin/virtualenv: No such file or directory


            And then install it again with pip3:



            $ pip3 install virtualenv
            Collecting virtualenv
            ...
            Installing collected packages: virtualenv
            Successfully installed virtualenv-16.1.0


            Notice the use of pip3, and not pip, unlike this link, pointed to by TensorFlow.



            And now creating the virtual environment works:



            $ virtualenv --system-site-packages -p python3 ./venv
            Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
            Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
            New python executable in ~/venv/bin/python3
            Also creating executable in ~/venv/bin/python
            Installing setuptools, pip, wheel...
            done.





            share|improve this answer

























              up vote
              1
              down vote













              After a few hours, one solution was to install virtualenv again with pip, then remove it with pip:



              $ ls -la /usr/local/bin/virtualenv
              -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv
              $ pip install virtualenv
              ...
              $ pip uninstall virtualenv
              ...
              $ which virtualenv
              $ ls -la /usr/local/bin/virtualenv
              ls: /usr/local/bin/virtualenv: No such file or directory


              And then install it again with pip3:



              $ pip3 install virtualenv
              Collecting virtualenv
              ...
              Installing collected packages: virtualenv
              Successfully installed virtualenv-16.1.0


              Notice the use of pip3, and not pip, unlike this link, pointed to by TensorFlow.



              And now creating the virtual environment works:



              $ virtualenv --system-site-packages -p python3 ./venv
              Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
              Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
              New python executable in ~/venv/bin/python3
              Also creating executable in ~/venv/bin/python
              Installing setuptools, pip, wheel...
              done.





              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                After a few hours, one solution was to install virtualenv again with pip, then remove it with pip:



                $ ls -la /usr/local/bin/virtualenv
                -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv
                $ pip install virtualenv
                ...
                $ pip uninstall virtualenv
                ...
                $ which virtualenv
                $ ls -la /usr/local/bin/virtualenv
                ls: /usr/local/bin/virtualenv: No such file or directory


                And then install it again with pip3:



                $ pip3 install virtualenv
                Collecting virtualenv
                ...
                Installing collected packages: virtualenv
                Successfully installed virtualenv-16.1.0


                Notice the use of pip3, and not pip, unlike this link, pointed to by TensorFlow.



                And now creating the virtual environment works:



                $ virtualenv --system-site-packages -p python3 ./venv
                Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
                Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
                New python executable in ~/venv/bin/python3
                Also creating executable in ~/venv/bin/python
                Installing setuptools, pip, wheel...
                done.





                share|improve this answer












                After a few hours, one solution was to install virtualenv again with pip, then remove it with pip:



                $ ls -la /usr/local/bin/virtualenv
                -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv
                $ pip install virtualenv
                ...
                $ pip uninstall virtualenv
                ...
                $ which virtualenv
                $ ls -la /usr/local/bin/virtualenv
                ls: /usr/local/bin/virtualenv: No such file or directory


                And then install it again with pip3:



                $ pip3 install virtualenv
                Collecting virtualenv
                ...
                Installing collected packages: virtualenv
                Successfully installed virtualenv-16.1.0


                Notice the use of pip3, and not pip, unlike this link, pointed to by TensorFlow.



                And now creating the virtual environment works:



                $ virtualenv --system-site-packages -p python3 ./venv
                Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
                Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
                New python executable in ~/venv/bin/python3
                Also creating executable in ~/venv/bin/python
                Installing setuptools, pip, wheel...
                done.






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 3 at 15:02









                mmorin

                2118




                2118






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f1380418%2fpython3-7-bad-interpreter-no-such-file-or-directory%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

                    Mouse cursor on multiple screens with different PPI

                    Agildo Ribeiro

                    Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”