PIP not installing to virtualenv directoryubuntu 11.04 install mysqldb for custom python2.5virtualenv gcc error MySQL-pythonPython eggs are not imported for Apache2 mod_wsgiError while installing with Python “pip”: Cannot fetch index base URL http://Python's 3.4a LEFOVERSHow do I re-compile python?How should virtualenv be set up in a production Web server (user, location, etc.)Django 1.10.3 Apache wsgi - ImportError: cannot import name signalsLinux “which virtualenv-2.7” shows a repeating pathError when trying install mod_wsgi using pip

As programers say: Strive to be lazy

Help in identifying a mystery wall socket

What kind of SATA connector is this?

What episode was being referenced by this part of Discovery's season 2 episode 13 recap?

Solubility in different pressure conditions

what does a native speaker say when he wanted to leave his work?

Is there anything special about -1 (0xFFFFFFFF) regarding ADC?

Safety when modifying old electrical work

Why do I get two different answers when solving for arclength?

Why is tomato paste so cheap?

What's the difference between "за ... от" and "в ... от"?

Is taking modulus on both sides of an equation valid?

Why was Endgame Thanos so different than Infinity War Thanos?

Do I need to say 'o`clock'?

Does SQL Server allow (make visible) DDL inside a transaction to the transaction prior to commit?

Entering the UK as a British citizen who is a Canadian permanent resident

Why is it harder to turn a motor/generator with shorted terminals?

Area under the curve - Integrals (Antiderivatives)

What is the best way for a skeleton to impersonate human without using magic?

Was this character’s old age look CGI or make-up?

Why does my circuit work on a breadboard, but not on a perfboard? I am new to soldering

How can a layman easily get the consensus view of what academia *thinks* about a subject?

What to do if SUS scores contradict qualitative feedback?

Smallest Guaranteed hash collision cycle length



PIP not installing to virtualenv directory


ubuntu 11.04 install mysqldb for custom python2.5virtualenv gcc error MySQL-pythonPython eggs are not imported for Apache2 mod_wsgiError while installing with Python “pip”: Cannot fetch index base URL http://Python's 3.4a LEFOVERSHow do I re-compile python?How should virtualenv be set up in a production Web server (user, location, etc.)Django 1.10.3 Apache wsgi - ImportError: cannot import name signalsLinux “which virtualenv-2.7” shows a repeating pathError when trying install mod_wsgi using pip






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








7















I am attempting to install django to a virtualenv that already exists.



Following the instructions listed on the pip-install website here, I ran the following from SSH.



name@server:~$ . myenv.env/bin/activate
(myenv.env)nam@server:~$ pip install django


However at the bottom of the installation, I am seeing this:



creating /usr/local/lib/python2.7/dist-packages/django

error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied


It appears that it is trying to install it to the global directory. I do not have sudo privileges. Am I doing something wrong here?



Update:
$PATH = /var/django/myenv.env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games










share|improve this question
























  • Does it work correctly for other packages? Do you have the same problem if you use easy_install?

    – larsks
    Jul 26 '13 at 17:28











  • Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory.

    – Luke Sapan
    Jul 26 '13 at 17:53











  • Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one.

    – larsks
    Jul 26 '13 at 17:55












  • Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/?

    – larsks
    Jul 26 '13 at 17:56












  • I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively.

    – Luke Sapan
    Jul 26 '13 at 18:20

















7















I am attempting to install django to a virtualenv that already exists.



Following the instructions listed on the pip-install website here, I ran the following from SSH.



name@server:~$ . myenv.env/bin/activate
(myenv.env)nam@server:~$ pip install django


However at the bottom of the installation, I am seeing this:



creating /usr/local/lib/python2.7/dist-packages/django

error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied


It appears that it is trying to install it to the global directory. I do not have sudo privileges. Am I doing something wrong here?



Update:
$PATH = /var/django/myenv.env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games










share|improve this question
























  • Does it work correctly for other packages? Do you have the same problem if you use easy_install?

    – larsks
    Jul 26 '13 at 17:28











  • Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory.

    – Luke Sapan
    Jul 26 '13 at 17:53











  • Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one.

    – larsks
    Jul 26 '13 at 17:55












  • Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/?

    – larsks
    Jul 26 '13 at 17:56












  • I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively.

    – Luke Sapan
    Jul 26 '13 at 18:20













7












7








7








I am attempting to install django to a virtualenv that already exists.



Following the instructions listed on the pip-install website here, I ran the following from SSH.



name@server:~$ . myenv.env/bin/activate
(myenv.env)nam@server:~$ pip install django


However at the bottom of the installation, I am seeing this:



creating /usr/local/lib/python2.7/dist-packages/django

error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied


It appears that it is trying to install it to the global directory. I do not have sudo privileges. Am I doing something wrong here?



Update:
$PATH = /var/django/myenv.env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games










share|improve this question
















I am attempting to install django to a virtualenv that already exists.



Following the instructions listed on the pip-install website here, I ran the following from SSH.



name@server:~$ . myenv.env/bin/activate
(myenv.env)nam@server:~$ pip install django


However at the bottom of the installation, I am seeing this:



creating /usr/local/lib/python2.7/dist-packages/django

error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied


It appears that it is trying to install it to the global directory. I do not have sudo privileges. Am I doing something wrong here?



Update:
$PATH = /var/django/myenv.env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games







python installation packages virtualenv pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 26 '13 at 18:40







Luke Sapan

















asked Jul 26 '13 at 17:21









Luke SapanLuke Sapan

621111




621111












  • Does it work correctly for other packages? Do you have the same problem if you use easy_install?

    – larsks
    Jul 26 '13 at 17:28











  • Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory.

    – Luke Sapan
    Jul 26 '13 at 17:53











  • Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one.

    – larsks
    Jul 26 '13 at 17:55












  • Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/?

    – larsks
    Jul 26 '13 at 17:56












  • I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively.

    – Luke Sapan
    Jul 26 '13 at 18:20

















  • Does it work correctly for other packages? Do you have the same problem if you use easy_install?

    – larsks
    Jul 26 '13 at 17:28











  • Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory.

    – Luke Sapan
    Jul 26 '13 at 17:53











  • Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one.

    – larsks
    Jul 26 '13 at 17:55












  • Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/?

    – larsks
    Jul 26 '13 at 17:56












  • I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively.

    – Luke Sapan
    Jul 26 '13 at 18:20
















Does it work correctly for other packages? Do you have the same problem if you use easy_install?

– larsks
Jul 26 '13 at 17:28





Does it work correctly for other packages? Do you have the same problem if you use easy_install?

– larsks
Jul 26 '13 at 17:28













Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory.

– Luke Sapan
Jul 26 '13 at 17:53





Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory.

– Luke Sapan
Jul 26 '13 at 17:53













Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one.

– larsks
Jul 26 '13 at 17:55






Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one.

– larsks
Jul 26 '13 at 17:55














Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/?

– larsks
Jul 26 '13 at 17:56






Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/?

– larsks
Jul 26 '13 at 17:56














I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively.

– Luke Sapan
Jul 26 '13 at 18:20





I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively.

– Luke Sapan
Jul 26 '13 at 18:20










6 Answers
6






active

oldest

votes


















3














Sorry for a year late answer! I had the same problem and fixed it, I don't know if you changed the name of a directory after creating the virtual environment, I did though. If so then here's what I did.



1.) deactivate your v-env. After the fix you need to restart the v-env, so might as well deactivate now. right?



2.) Now, since we created the v-env in a different path, we have to change the static path variables in these files.



To get pip working you don't need to do this, but I still do.
bin/activate,
bin/activate.csh,
bin/activate.fish



bin/pip,
bin/pip2,
bin/pip2.7



bin/easy_install,
bin/easy_install2.7



3.) To get pip working, you must correct the python interpreter in the pip file, this as well has a static interpreter location set by virtualenv in the creation process.



4.) To get easy_install working? You guessed it, fix the interpreter location.



I hope this helped for any people reading this in the future. Sorry OP, for being late.






share|improve this answer























  • Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

    – Luke Sapan
    Jun 6 '15 at 16:29











  • Glad to be of help

    – Crispy
    Jun 6 '15 at 16:41











  • I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

    – Keith
    Feb 25 '17 at 6:56



















2














I had this same problem.



I deleted the virtual environment and created a new one, which solved the problem.



Probably not the answer you were hoping for, but since it's the only one...






share|improve this answer






























    1














    Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your requirements file and it should work.






    share|improve this answer






























      0














      Had the same problem. In my case the reason was that the created virtual env was for python2.7 (the default) but I was using pip3 to install a package. pip3 was not present in my virtualenv so it defaulted to the global one. For me the fix was to use



      virtualenv flask --python=python3


      to create the env.






      share|improve this answer






























        0














        I had encountered the same problem caused by renaming of user.
        Crispy's answer is totally right. And my solution may be more convenient.



        setps:

        1. Enter your virtual environment's bin path, such as cd ~/virenv_dir/bin

        2. Rename all files under this directory using sed command. sed -i 's/old_name/new_name/' *






        share|improve this answer
































          0














          In my case, I had defined two aliases (to overcome some other issue on the default python version):



          alias pip='/usr/bin/pip3'
          alias python='/usr/bin/python3'


          And this was causing the same symptoms:



          [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages'


          Removing the aliases solved the issue (before or after creating the virtualenv)






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            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%2fserverfault.com%2fquestions%2f526594%2fpip-not-installing-to-virtualenv-directory%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            6 Answers
            6






            active

            oldest

            votes








            6 Answers
            6






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            Sorry for a year late answer! I had the same problem and fixed it, I don't know if you changed the name of a directory after creating the virtual environment, I did though. If so then here's what I did.



            1.) deactivate your v-env. After the fix you need to restart the v-env, so might as well deactivate now. right?



            2.) Now, since we created the v-env in a different path, we have to change the static path variables in these files.



            To get pip working you don't need to do this, but I still do.
            bin/activate,
            bin/activate.csh,
            bin/activate.fish



            bin/pip,
            bin/pip2,
            bin/pip2.7



            bin/easy_install,
            bin/easy_install2.7



            3.) To get pip working, you must correct the python interpreter in the pip file, this as well has a static interpreter location set by virtualenv in the creation process.



            4.) To get easy_install working? You guessed it, fix the interpreter location.



            I hope this helped for any people reading this in the future. Sorry OP, for being late.






            share|improve this answer























            • Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

              – Luke Sapan
              Jun 6 '15 at 16:29











            • Glad to be of help

              – Crispy
              Jun 6 '15 at 16:41











            • I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

              – Keith
              Feb 25 '17 at 6:56
















            3














            Sorry for a year late answer! I had the same problem and fixed it, I don't know if you changed the name of a directory after creating the virtual environment, I did though. If so then here's what I did.



            1.) deactivate your v-env. After the fix you need to restart the v-env, so might as well deactivate now. right?



            2.) Now, since we created the v-env in a different path, we have to change the static path variables in these files.



            To get pip working you don't need to do this, but I still do.
            bin/activate,
            bin/activate.csh,
            bin/activate.fish



            bin/pip,
            bin/pip2,
            bin/pip2.7



            bin/easy_install,
            bin/easy_install2.7



            3.) To get pip working, you must correct the python interpreter in the pip file, this as well has a static interpreter location set by virtualenv in the creation process.



            4.) To get easy_install working? You guessed it, fix the interpreter location.



            I hope this helped for any people reading this in the future. Sorry OP, for being late.






            share|improve this answer























            • Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

              – Luke Sapan
              Jun 6 '15 at 16:29











            • Glad to be of help

              – Crispy
              Jun 6 '15 at 16:41











            • I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

              – Keith
              Feb 25 '17 at 6:56














            3












            3








            3







            Sorry for a year late answer! I had the same problem and fixed it, I don't know if you changed the name of a directory after creating the virtual environment, I did though. If so then here's what I did.



            1.) deactivate your v-env. After the fix you need to restart the v-env, so might as well deactivate now. right?



            2.) Now, since we created the v-env in a different path, we have to change the static path variables in these files.



            To get pip working you don't need to do this, but I still do.
            bin/activate,
            bin/activate.csh,
            bin/activate.fish



            bin/pip,
            bin/pip2,
            bin/pip2.7



            bin/easy_install,
            bin/easy_install2.7



            3.) To get pip working, you must correct the python interpreter in the pip file, this as well has a static interpreter location set by virtualenv in the creation process.



            4.) To get easy_install working? You guessed it, fix the interpreter location.



            I hope this helped for any people reading this in the future. Sorry OP, for being late.






            share|improve this answer













            Sorry for a year late answer! I had the same problem and fixed it, I don't know if you changed the name of a directory after creating the virtual environment, I did though. If so then here's what I did.



            1.) deactivate your v-env. After the fix you need to restart the v-env, so might as well deactivate now. right?



            2.) Now, since we created the v-env in a different path, we have to change the static path variables in these files.



            To get pip working you don't need to do this, but I still do.
            bin/activate,
            bin/activate.csh,
            bin/activate.fish



            bin/pip,
            bin/pip2,
            bin/pip2.7



            bin/easy_install,
            bin/easy_install2.7



            3.) To get pip working, you must correct the python interpreter in the pip file, this as well has a static interpreter location set by virtualenv in the creation process.



            4.) To get easy_install working? You guessed it, fix the interpreter location.



            I hope this helped for any people reading this in the future. Sorry OP, for being late.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 6 '15 at 16:07









            CrispyCrispy

            1461




            1461












            • Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

              – Luke Sapan
              Jun 6 '15 at 16:29











            • Glad to be of help

              – Crispy
              Jun 6 '15 at 16:41











            • I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

              – Keith
              Feb 25 '17 at 6:56


















            • Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

              – Luke Sapan
              Jun 6 '15 at 16:29











            • Glad to be of help

              – Crispy
              Jun 6 '15 at 16:41











            • I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

              – Keith
              Feb 25 '17 at 6:56

















            Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

            – Luke Sapan
            Jun 6 '15 at 16:29





            Yeah that was exactly it. In my case I was able to just re-create the virtualenv from scratch and that solved it.

            – Luke Sapan
            Jun 6 '15 at 16:29













            Glad to be of help

            – Crispy
            Jun 6 '15 at 16:41





            Glad to be of help

            – Crispy
            Jun 6 '15 at 16:41













            I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

            – Keith
            Feb 25 '17 at 6:56






            I'm so glad to finally find an answer. For me, using sed in the venv folder made the job a lot easier. Something like grep -rli '/path/to/old/env/bin' * | xargs -i@ sed -i 's//path/to/old/env/bin//path/to/new/env/bin/g' @.source

            – Keith
            Feb 25 '17 at 6:56














            2














            I had this same problem.



            I deleted the virtual environment and created a new one, which solved the problem.



            Probably not the answer you were hoping for, but since it's the only one...






            share|improve this answer



























              2














              I had this same problem.



              I deleted the virtual environment and created a new one, which solved the problem.



              Probably not the answer you were hoping for, but since it's the only one...






              share|improve this answer

























                2












                2








                2







                I had this same problem.



                I deleted the virtual environment and created a new one, which solved the problem.



                Probably not the answer you were hoping for, but since it's the only one...






                share|improve this answer













                I had this same problem.



                I deleted the virtual environment and created a new one, which solved the problem.



                Probably not the answer you were hoping for, but since it's the only one...







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 3 '14 at 15:43









                MarkMark

                1516




                1516





















                    1














                    Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your requirements file and it should work.






                    share|improve this answer



























                      1














                      Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your requirements file and it should work.






                      share|improve this answer

























                        1












                        1








                        1







                        Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your requirements file and it should work.






                        share|improve this answer













                        Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your requirements file and it should work.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Mar 3 '14 at 16:48









                        secure212secure212

                        1531210




                        1531210





















                            0














                            Had the same problem. In my case the reason was that the created virtual env was for python2.7 (the default) but I was using pip3 to install a package. pip3 was not present in my virtualenv so it defaulted to the global one. For me the fix was to use



                            virtualenv flask --python=python3


                            to create the env.






                            share|improve this answer



























                              0














                              Had the same problem. In my case the reason was that the created virtual env was for python2.7 (the default) but I was using pip3 to install a package. pip3 was not present in my virtualenv so it defaulted to the global one. For me the fix was to use



                              virtualenv flask --python=python3


                              to create the env.






                              share|improve this answer

























                                0












                                0








                                0







                                Had the same problem. In my case the reason was that the created virtual env was for python2.7 (the default) but I was using pip3 to install a package. pip3 was not present in my virtualenv so it defaulted to the global one. For me the fix was to use



                                virtualenv flask --python=python3


                                to create the env.






                                share|improve this answer













                                Had the same problem. In my case the reason was that the created virtual env was for python2.7 (the default) but I was using pip3 to install a package. pip3 was not present in my virtualenv so it defaulted to the global one. For me the fix was to use



                                virtualenv flask --python=python3


                                to create the env.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Nov 20 '15 at 14:10









                                AdversusAdversus

                                1163




                                1163





















                                    0














                                    I had encountered the same problem caused by renaming of user.
                                    Crispy's answer is totally right. And my solution may be more convenient.



                                    setps:

                                    1. Enter your virtual environment's bin path, such as cd ~/virenv_dir/bin

                                    2. Rename all files under this directory using sed command. sed -i 's/old_name/new_name/' *






                                    share|improve this answer





























                                      0














                                      I had encountered the same problem caused by renaming of user.
                                      Crispy's answer is totally right. And my solution may be more convenient.



                                      setps:

                                      1. Enter your virtual environment's bin path, such as cd ~/virenv_dir/bin

                                      2. Rename all files under this directory using sed command. sed -i 's/old_name/new_name/' *






                                      share|improve this answer



























                                        0












                                        0








                                        0







                                        I had encountered the same problem caused by renaming of user.
                                        Crispy's answer is totally right. And my solution may be more convenient.



                                        setps:

                                        1. Enter your virtual environment's bin path, such as cd ~/virenv_dir/bin

                                        2. Rename all files under this directory using sed command. sed -i 's/old_name/new_name/' *






                                        share|improve this answer















                                        I had encountered the same problem caused by renaming of user.
                                        Crispy's answer is totally right. And my solution may be more convenient.



                                        setps:

                                        1. Enter your virtual environment's bin path, such as cd ~/virenv_dir/bin

                                        2. Rename all files under this directory using sed command. sed -i 's/old_name/new_name/' *







                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Nov 13 '17 at 18:11









                                        Vaibhav Panmand

                                        761411




                                        761411










                                        answered Nov 13 '17 at 12:11









                                        xialuxialu

                                        1




                                        1





















                                            0














                                            In my case, I had defined two aliases (to overcome some other issue on the default python version):



                                            alias pip='/usr/bin/pip3'
                                            alias python='/usr/bin/python3'


                                            And this was causing the same symptoms:



                                            [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages'


                                            Removing the aliases solved the issue (before or after creating the virtualenv)






                                            share|improve this answer



























                                              0














                                              In my case, I had defined two aliases (to overcome some other issue on the default python version):



                                              alias pip='/usr/bin/pip3'
                                              alias python='/usr/bin/python3'


                                              And this was causing the same symptoms:



                                              [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages'


                                              Removing the aliases solved the issue (before or after creating the virtualenv)






                                              share|improve this answer

























                                                0












                                                0








                                                0







                                                In my case, I had defined two aliases (to overcome some other issue on the default python version):



                                                alias pip='/usr/bin/pip3'
                                                alias python='/usr/bin/python3'


                                                And this was causing the same symptoms:



                                                [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages'


                                                Removing the aliases solved the issue (before or after creating the virtualenv)






                                                share|improve this answer













                                                In my case, I had defined two aliases (to overcome some other issue on the default python version):



                                                alias pip='/usr/bin/pip3'
                                                alias python='/usr/bin/python3'


                                                And this was causing the same symptoms:



                                                [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages'


                                                Removing the aliases solved the issue (before or after creating the virtualenv)







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered May 2 at 20:03









                                                coderazzicoderazzi

                                                1012




                                                1012



























                                                    draft saved

                                                    draft discarded
















































                                                    Thanks for contributing an answer to Server Fault!


                                                    • 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%2fserverfault.com%2fquestions%2f526594%2fpip-not-installing-to-virtualenv-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

                                                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                                                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                                                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020