Passing src for pip to conda env create











up vote
2
down vote

favorite












I am creating a conda environment using conda env create --json --force -f ${CONDA_ENV_FILE} where there is a pip section in the file that contains some editable git installs. I would like to control where the git clone happens. pip has a flag --src that can be set to control that. Is there a way to have conda pass that flag to pip?










share|improve this question


























    up vote
    2
    down vote

    favorite












    I am creating a conda environment using conda env create --json --force -f ${CONDA_ENV_FILE} where there is a pip section in the file that contains some editable git installs. I would like to control where the git clone happens. pip has a flag --src that can be set to control that. Is there a way to have conda pass that flag to pip?










    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I am creating a conda environment using conda env create --json --force -f ${CONDA_ENV_FILE} where there is a pip section in the file that contains some editable git installs. I would like to control where the git clone happens. pip has a flag --src that can be set to control that. Is there a way to have conda pass that flag to pip?










      share|improve this question













      I am creating a conda environment using conda env create --json --force -f ${CONDA_ENV_FILE} where there is a pip section in the file that contains some editable git installs. I would like to control where the git clone happens. pip has a flag --src that can be set to control that. Is there a way to have conda pass that flag to pip?







      conda






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 4 at 14:55









      Alex Rothberg

      2,50242766




      2,50242766
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          tl;dr sort of: you can use PIP_SRC=<src_folder> to override the default src folder.



          Sadly conda doesn't currently support use of the --src flags because it runs pip install -r requirements.txt under the hood, without any way of injecting global pip options (see source code).
          The requirements.txt file format specification specifies that --src isn't a supported global option, so we can't go down that route, however there is a --install-option option that is supported on a per project basis that allows you to pass arbitrary options to the dependency's setup.py invocation however at this stage it's too late as the dependency has already been downloaded at this point.



          One saving grace is the fact all of pip's flags can be specified as environment variables, so if you want to specify pip install --src <src_dir> blah you can use PIP_SRC=<src_dir> pip install blah






          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%2f49654239%2fpassing-src-for-pip-to-conda-env-create%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













            tl;dr sort of: you can use PIP_SRC=<src_folder> to override the default src folder.



            Sadly conda doesn't currently support use of the --src flags because it runs pip install -r requirements.txt under the hood, without any way of injecting global pip options (see source code).
            The requirements.txt file format specification specifies that --src isn't a supported global option, so we can't go down that route, however there is a --install-option option that is supported on a per project basis that allows you to pass arbitrary options to the dependency's setup.py invocation however at this stage it's too late as the dependency has already been downloaded at this point.



            One saving grace is the fact all of pip's flags can be specified as environment variables, so if you want to specify pip install --src <src_dir> blah you can use PIP_SRC=<src_dir> pip install blah






            share|improve this answer



























              up vote
              0
              down vote













              tl;dr sort of: you can use PIP_SRC=<src_folder> to override the default src folder.



              Sadly conda doesn't currently support use of the --src flags because it runs pip install -r requirements.txt under the hood, without any way of injecting global pip options (see source code).
              The requirements.txt file format specification specifies that --src isn't a supported global option, so we can't go down that route, however there is a --install-option option that is supported on a per project basis that allows you to pass arbitrary options to the dependency's setup.py invocation however at this stage it's too late as the dependency has already been downloaded at this point.



              One saving grace is the fact all of pip's flags can be specified as environment variables, so if you want to specify pip install --src <src_dir> blah you can use PIP_SRC=<src_dir> pip install blah






              share|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                tl;dr sort of: you can use PIP_SRC=<src_folder> to override the default src folder.



                Sadly conda doesn't currently support use of the --src flags because it runs pip install -r requirements.txt under the hood, without any way of injecting global pip options (see source code).
                The requirements.txt file format specification specifies that --src isn't a supported global option, so we can't go down that route, however there is a --install-option option that is supported on a per project basis that allows you to pass arbitrary options to the dependency's setup.py invocation however at this stage it's too late as the dependency has already been downloaded at this point.



                One saving grace is the fact all of pip's flags can be specified as environment variables, so if you want to specify pip install --src <src_dir> blah you can use PIP_SRC=<src_dir> pip install blah






                share|improve this answer














                tl;dr sort of: you can use PIP_SRC=<src_folder> to override the default src folder.



                Sadly conda doesn't currently support use of the --src flags because it runs pip install -r requirements.txt under the hood, without any way of injecting global pip options (see source code).
                The requirements.txt file format specification specifies that --src isn't a supported global option, so we can't go down that route, however there is a --install-option option that is supported on a per project basis that allows you to pass arbitrary options to the dependency's setup.py invocation however at this stage it's too late as the dependency has already been downloaded at this point.



                One saving grace is the fact all of pip's flags can be specified as environment variables, so if you want to specify pip install --src <src_dir> blah you can use PIP_SRC=<src_dir> pip install blah







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 18 at 19:48

























                answered Nov 18 at 18:55









                Will

                29159




                29159






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49654239%2fpassing-src-for-pip-to-conda-env-create%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

                    Paul Cézanne

                    UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

                    Angular material date-picker (MatDatepicker) auto completes the date on focus out