Equivalent to “source” in OpenBSD?












2















Trying to open a python3 virtual environment I have created with



python3 -m venv myVenv


by doing



source myVenv/bin/activate


as I do in Linux, but I get



ksh: source: not found


wich mean it is not in my path/installed. When I try to add it with pkg_add it just tell me it cant find it. Does OpenBSD use something else that allows me to use venv or what should I do?










share|improve this question

























  • source is a bash command. To switch to bash as your login shell, if this would make your life easier, install the bash port/package and update your login shell with chsh. bash would be installed as /usr/local/bin/bash on OpenBSD.

    – Kusalananda
    10 hours ago


















2















Trying to open a python3 virtual environment I have created with



python3 -m venv myVenv


by doing



source myVenv/bin/activate


as I do in Linux, but I get



ksh: source: not found


wich mean it is not in my path/installed. When I try to add it with pkg_add it just tell me it cant find it. Does OpenBSD use something else that allows me to use venv or what should I do?










share|improve this question

























  • source is a bash command. To switch to bash as your login shell, if this would make your life easier, install the bash port/package and update your login shell with chsh. bash would be installed as /usr/local/bin/bash on OpenBSD.

    – Kusalananda
    10 hours ago
















2












2








2


1






Trying to open a python3 virtual environment I have created with



python3 -m venv myVenv


by doing



source myVenv/bin/activate


as I do in Linux, but I get



ksh: source: not found


wich mean it is not in my path/installed. When I try to add it with pkg_add it just tell me it cant find it. Does OpenBSD use something else that allows me to use venv or what should I do?










share|improve this question
















Trying to open a python3 virtual environment I have created with



python3 -m venv myVenv


by doing



source myVenv/bin/activate


as I do in Linux, but I get



ksh: source: not found


wich mean it is not in my path/installed. When I try to add it with pkg_add it just tell me it cant find it. Does OpenBSD use something else that allows me to use venv or what should I do?







python environment-variables ksh openbsd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago









200_success

3,92711528




3,92711528










asked 11 hours ago









SalviatiSalviati

1146




1146













  • source is a bash command. To switch to bash as your login shell, if this would make your life easier, install the bash port/package and update your login shell with chsh. bash would be installed as /usr/local/bin/bash on OpenBSD.

    – Kusalananda
    10 hours ago





















  • source is a bash command. To switch to bash as your login shell, if this would make your life easier, install the bash port/package and update your login shell with chsh. bash would be installed as /usr/local/bin/bash on OpenBSD.

    – Kusalananda
    10 hours ago



















source is a bash command. To switch to bash as your login shell, if this would make your life easier, install the bash port/package and update your login shell with chsh. bash would be installed as /usr/local/bin/bash on OpenBSD.

– Kusalananda
10 hours ago







source is a bash command. To switch to bash as your login shell, if this would make your life easier, install the bash port/package and update your login shell with chsh. bash would be installed as /usr/local/bin/bash on OpenBSD.

– Kusalananda
10 hours ago












3 Answers
3






active

oldest

votes


















12














You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The command that you want is the . command.



Further reading




  • What is the difference between '.' and 'source' in shells?






share|improve this answer































    6














    The source keyword which is available in bash is not part of the Posix standard. Instead you can use



    . myVenv/bin/activate


    You could use the same syntax with . in bash which you are using on your Linux system.






    share|improve this answer

































      -1














      As an alternative, you can simply launch a new bash shell, and source it there:



      ksh$ bash
      bash$ source myVenv/bin/activate
      (myVenv) bash$ python ...


      As a bonus, this gives you an easy way to deactivate the venv and return to a pristine environment: just exit from the bash shell and you'll return to ksh!






      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "106"
        };
        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: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        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%2funix.stackexchange.com%2fquestions%2f504305%2fequivalent-to-source-in-openbsd%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        12














        You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The command that you want is the . command.



        Further reading




        • What is the difference between '.' and 'source' in shells?






        share|improve this answer




























          12














          You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The command that you want is the . command.



          Further reading




          • What is the difference between '.' and 'source' in shells?






          share|improve this answer


























            12












            12








            12







            You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The command that you want is the . command.



            Further reading




            • What is the difference between '.' and 'source' in shells?






            share|improve this answer













            You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The command that you want is the . command.



            Further reading




            • What is the difference between '.' and 'source' in shells?







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 10 hours ago









            JdeBPJdeBP

            35.8k473171




            35.8k473171

























                6














                The source keyword which is available in bash is not part of the Posix standard. Instead you can use



                . myVenv/bin/activate


                You could use the same syntax with . in bash which you are using on your Linux system.






                share|improve this answer






























                  6














                  The source keyword which is available in bash is not part of the Posix standard. Instead you can use



                  . myVenv/bin/activate


                  You could use the same syntax with . in bash which you are using on your Linux system.






                  share|improve this answer




























                    6












                    6








                    6







                    The source keyword which is available in bash is not part of the Posix standard. Instead you can use



                    . myVenv/bin/activate


                    You could use the same syntax with . in bash which you are using on your Linux system.






                    share|improve this answer















                    The source keyword which is available in bash is not part of the Posix standard. Instead you can use



                    . myVenv/bin/activate


                    You could use the same syntax with . in bash which you are using on your Linux system.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 10 hours ago

























                    answered 10 hours ago









                    BodoBodo

                    1,993314




                    1,993314























                        -1














                        As an alternative, you can simply launch a new bash shell, and source it there:



                        ksh$ bash
                        bash$ source myVenv/bin/activate
                        (myVenv) bash$ python ...


                        As a bonus, this gives you an easy way to deactivate the venv and return to a pristine environment: just exit from the bash shell and you'll return to ksh!






                        share|improve this answer




























                          -1














                          As an alternative, you can simply launch a new bash shell, and source it there:



                          ksh$ bash
                          bash$ source myVenv/bin/activate
                          (myVenv) bash$ python ...


                          As a bonus, this gives you an easy way to deactivate the venv and return to a pristine environment: just exit from the bash shell and you'll return to ksh!






                          share|improve this answer


























                            -1












                            -1








                            -1







                            As an alternative, you can simply launch a new bash shell, and source it there:



                            ksh$ bash
                            bash$ source myVenv/bin/activate
                            (myVenv) bash$ python ...


                            As a bonus, this gives you an easy way to deactivate the venv and return to a pristine environment: just exit from the bash shell and you'll return to ksh!






                            share|improve this answer













                            As an alternative, you can simply launch a new bash shell, and source it there:



                            ksh$ bash
                            bash$ source myVenv/bin/activate
                            (myVenv) bash$ python ...


                            As a bonus, this gives you an easy way to deactivate the venv and return to a pristine environment: just exit from the bash shell and you'll return to ksh!







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 8 hours ago









                            Daniel PrydenDaniel Pryden

                            1896




                            1896






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • 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%2funix.stackexchange.com%2fquestions%2f504305%2fequivalent-to-source-in-openbsd%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

                                GameSpot

                                日野市

                                Tu-95轟炸機