What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Can a tourist shoot a gun in the USA?

Will a coyote attack my dog on a leash while I'm on a hiking trail?

Labeling matrices/rectangles and drawing Sigma inside rectangle

How can I answer high-school writing prompts without sounding weird and fake?

Is there ever any indication in the MCU as to how Spider-Man got his powers?

Jumping frame contents with beamer and pgfplots

Would an 8% reduction in drag outweigh the weight addition from this custom CFD-tested winglet?

Is it possible to create different colors in rocket exhaust?

German characters on US-International keyboard layout

Does gravity affect the time evolution of a QM wave function?

51% attack - apparently very easy? refering to CZ's "rollback btc chain" - How to make sure such corruptible scenario can never happen so easily?

Why are solar panels kept tilted?

Is Germany still exporting arms to countries involved in Yemen?

Unexpected Netflix account registered to my Gmail address - any way it could be a hack attempt?

Help in identifying a mystery wall socket

Frame adjustment for engine

Rounding a number extracted by jq to limit the decimal points

Why did the metro bus stop at each railway crossing, despite no warning indicating a train was coming?

Anatomically Correct Carnivorous Tree

Why do the lights go out when someone enters the dining room on this ship?

Solubility in different pressure conditions

Is taking modulus on both sides of an equation valid?

What is the largest number of identical satellites launched together?

return tuple of uncopyable objects



What if the end-user didn't have the required library?


What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?






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








15















My Python project uses various kind of libraries. What is the protocol if the end-user didn't have one or any of them?



Should a window pop up and notify him/her which package and version to download in his/her environment? Or I should include the libraries within my project?



What's the proper action?










share|improve this question
























  • Depends on what you mean by "proper".

    – Scott Hunter
    May 2 at 13:20











  • Related: Best practice to install dependencies?

    – Aran-Fey
    May 2 at 13:22

















15















My Python project uses various kind of libraries. What is the protocol if the end-user didn't have one or any of them?



Should a window pop up and notify him/her which package and version to download in his/her environment? Or I should include the libraries within my project?



What's the proper action?










share|improve this question
























  • Depends on what you mean by "proper".

    – Scott Hunter
    May 2 at 13:20











  • Related: Best practice to install dependencies?

    – Aran-Fey
    May 2 at 13:22













15












15








15


8






My Python project uses various kind of libraries. What is the protocol if the end-user didn't have one or any of them?



Should a window pop up and notify him/her which package and version to download in his/her environment? Or I should include the libraries within my project?



What's the proper action?










share|improve this question
















My Python project uses various kind of libraries. What is the protocol if the end-user didn't have one or any of them?



Should a window pop up and notify him/her which package and version to download in his/her environment? Or I should include the libraries within my project?



What's the proper action?







python python-3.x






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 2 at 22:17







Kepler 186

















asked May 2 at 13:17









Kepler 186Kepler 186

896




896












  • Depends on what you mean by "proper".

    – Scott Hunter
    May 2 at 13:20











  • Related: Best practice to install dependencies?

    – Aran-Fey
    May 2 at 13:22

















  • Depends on what you mean by "proper".

    – Scott Hunter
    May 2 at 13:20











  • Related: Best practice to install dependencies?

    – Aran-Fey
    May 2 at 13:22
















Depends on what you mean by "proper".

– Scott Hunter
May 2 at 13:20





Depends on what you mean by "proper".

– Scott Hunter
May 2 at 13:20













Related: Best practice to install dependencies?

– Aran-Fey
May 2 at 13:22





Related: Best practice to install dependencies?

– Aran-Fey
May 2 at 13:22












5 Answers
5






active

oldest

votes


















13














Whatever your project is, you could try making it into a python package that the end-user would install. The way this works is



In the root directory of your package you would include a setup.py. You could include in this file a list of requirements/dependencies (the install_requires key) that would be installed along with your package when the end-user installs it.



The end user could then use pip to install your package eg



pip install YourPackage


and all dependencies listed in setup.py would be installed first.



Additionally, as @Devesh Kumar Singh pointed out in his comment, you could also include a requirements.txt file. The user could then install using this file with



pip install -r requirements.txt YourPackage


See this guide for building a python package,
setuptools documentation






share|improve this answer

























  • Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

    – Kepler 186
    May 2 at 13:54







  • 1





    @RSHAP No, that would conflate the environment with the dependencies

    – Arne
    May 2 at 13:59






  • 2





    @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

    – Arne
    May 2 at 14:00






  • 2





    yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

    – Arne
    May 2 at 14:05







  • 1





    @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

    – MilkyWay90
    May 2 at 23:49


















5














To show other users, what libraries are needed for your project, you have multiple options. All options are some kind of files, that say which libraries are needed for this project.



Files that I am aware of




  • requirements.txt: very simple


  • setup.py: Used when you publish your project on sides like pypi https://stackoverflow.com/a/1472014/8411228


  • Pipfile: The way to go when you work in an virtualenv https://docs.pipenv.org/en/latest/


  • environment.yml: Used for Conda environments https://tdhopper.com/blog/my-python-environment-workflow-with-conda/#fn:requirements-conda





share|improve this answer






























    3














    Another option: You can use PyInstaller to freeze (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.



    PyInstaller Quickstart



    This has worked very well for me. Indeed, you do not have to worry about whether the final user has Python installed.






    share|improve this answer






























      1














      Here is where packaging a python project into a module comes handy modules
      We include a requirements.txt file which contains all python module requirements needed for that python library, and installs them automatically when the module is setup.



      A good primer on how to setup your module to be distributable is Structuring your project






      share|improve this answer

























      • Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

        – 3UqU57GnaX
        May 2 at 13:24











      • Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

        – Devesh Kumar Singh
        May 2 at 13:25


















      1














      So you made a package. Now you will want to share it. What next?



      Developer



      Goal - make a distribution (also called a "package") to share



      Preamble



      You are now packaging your package and wish to distribute it. There are two main kinds of packages:



      • an application: deploy a source to a server, github, website e.g. CLI

      • a library: publish a source distribution (sdist) or binary (e.g. wheel) usually to PyPI via twine

      Traditional Ways



      Several files may be included in a distribution, but here are the main ones:



      • source: your code


      • setup.py: specify metadata, and dependencies required to make an sdist.


      • requirements.txt: a list of dependencies

      Contemporary Ways



      Use pyproject.toml to specify which tool to use in creating your sdist or binary:



      Modern tools to create + deploy/publish a package include:




      1. pipenv: makes a package and substitutes requirements.txt (recommended by PyPA)

        • develop: > pipenv install <dependency>, > pipenv install

        • publish: > pipenv -e . + twine



      2. poetry: makes a package and publishes to PyPI

        • develop > poetry add <dependency>, > poetry install

        • publish: > poetry publish



      3. flit: makes a package and publishes to PyPI

        • develop: > flit install

        • publish: > flit publish


      The first two options have features to make clean virtual environments and safely install dependencies using lock files. I would encourage exploring these newer options later on as they clear up a lot of packaging headaches by obviating setup.py and setuptools.




      User



      Goal - get a package and install it with dependencies



      Traditional Ways



      Applications have a variety of deployment methods, e.g. uploading your app to a hosting service e.g. heroku, DigitalOcean, etc. The user may indirectly interface with your app through a website, CLI or more.



      Libraries are often uploaded to PyPI. From here the user can usually install a package using pip independent from how they are made:




      • > pip install <package> (recommended)


      • > pip install <packatge> -r requirements (explicit, optional)

      These commandline invocations will fetch the distribution from PyPI, install the package and specified dependencies.



      Contemporary Ways



      Here are some alternatives to pip:




      1. pipx: "safely" install packages in isolated environments

        • > pipx install <package>


      See Also




      • Official docs on publishing packages by PyPA


      • Tutorial on How To Package Your Python Code


      • Podcast interview with B. Cannon on pyproject.toml and modern packaging tools





      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',
        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%2fstackoverflow.com%2fquestions%2f55953391%2fwhat-if-the-end-user-didnt-have-the-required-library%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        13














        Whatever your project is, you could try making it into a python package that the end-user would install. The way this works is



        In the root directory of your package you would include a setup.py. You could include in this file a list of requirements/dependencies (the install_requires key) that would be installed along with your package when the end-user installs it.



        The end user could then use pip to install your package eg



        pip install YourPackage


        and all dependencies listed in setup.py would be installed first.



        Additionally, as @Devesh Kumar Singh pointed out in his comment, you could also include a requirements.txt file. The user could then install using this file with



        pip install -r requirements.txt YourPackage


        See this guide for building a python package,
        setuptools documentation






        share|improve this answer

























        • Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

          – Kepler 186
          May 2 at 13:54







        • 1





          @RSHAP No, that would conflate the environment with the dependencies

          – Arne
          May 2 at 13:59






        • 2





          @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

          – Arne
          May 2 at 14:00






        • 2





          yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

          – Arne
          May 2 at 14:05







        • 1





          @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

          – MilkyWay90
          May 2 at 23:49















        13














        Whatever your project is, you could try making it into a python package that the end-user would install. The way this works is



        In the root directory of your package you would include a setup.py. You could include in this file a list of requirements/dependencies (the install_requires key) that would be installed along with your package when the end-user installs it.



        The end user could then use pip to install your package eg



        pip install YourPackage


        and all dependencies listed in setup.py would be installed first.



        Additionally, as @Devesh Kumar Singh pointed out in his comment, you could also include a requirements.txt file. The user could then install using this file with



        pip install -r requirements.txt YourPackage


        See this guide for building a python package,
        setuptools documentation






        share|improve this answer

























        • Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

          – Kepler 186
          May 2 at 13:54







        • 1





          @RSHAP No, that would conflate the environment with the dependencies

          – Arne
          May 2 at 13:59






        • 2





          @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

          – Arne
          May 2 at 14:00






        • 2





          yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

          – Arne
          May 2 at 14:05







        • 1





          @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

          – MilkyWay90
          May 2 at 23:49













        13












        13








        13







        Whatever your project is, you could try making it into a python package that the end-user would install. The way this works is



        In the root directory of your package you would include a setup.py. You could include in this file a list of requirements/dependencies (the install_requires key) that would be installed along with your package when the end-user installs it.



        The end user could then use pip to install your package eg



        pip install YourPackage


        and all dependencies listed in setup.py would be installed first.



        Additionally, as @Devesh Kumar Singh pointed out in his comment, you could also include a requirements.txt file. The user could then install using this file with



        pip install -r requirements.txt YourPackage


        See this guide for building a python package,
        setuptools documentation






        share|improve this answer















        Whatever your project is, you could try making it into a python package that the end-user would install. The way this works is



        In the root directory of your package you would include a setup.py. You could include in this file a list of requirements/dependencies (the install_requires key) that would be installed along with your package when the end-user installs it.



        The end user could then use pip to install your package eg



        pip install YourPackage


        and all dependencies listed in setup.py would be installed first.



        Additionally, as @Devesh Kumar Singh pointed out in his comment, you could also include a requirements.txt file. The user could then install using this file with



        pip install -r requirements.txt YourPackage


        See this guide for building a python package,
        setuptools documentation







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 2 at 19:26









        Mooseman

        16.5k116184




        16.5k116184










        answered May 2 at 13:25









        RSHAPRSHAP

        1,071417




        1,071417












        • Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

          – Kepler 186
          May 2 at 13:54







        • 1





          @RSHAP No, that would conflate the environment with the dependencies

          – Arne
          May 2 at 13:59






        • 2





          @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

          – Arne
          May 2 at 14:00






        • 2





          yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

          – Arne
          May 2 at 14:05







        • 1





          @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

          – MilkyWay90
          May 2 at 23:49

















        • Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

          – Kepler 186
          May 2 at 13:54







        • 1





          @RSHAP No, that would conflate the environment with the dependencies

          – Arne
          May 2 at 13:59






        • 2





          @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

          – Arne
          May 2 at 14:00






        • 2





          yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

          – Arne
          May 2 at 14:05







        • 1





          @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

          – MilkyWay90
          May 2 at 23:49
















        Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

        – Kepler 186
        May 2 at 13:54






        Interesting. Also, I could just include os.system("pip install -r requirements.txt") in the setup.py right? Or the requirements.txt meant to be read by the user?

        – Kepler 186
        May 2 at 13:54





        1




        1





        @RSHAP No, that would conflate the environment with the dependencies

        – Arne
        May 2 at 13:59





        @RSHAP No, that would conflate the environment with the dependencies

        – Arne
        May 2 at 13:59




        2




        2





        @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

        – Arne
        May 2 at 14:00





        @RSHAP dstufft on the matter: caremad.io/posts/2013/07/setup-vs-requirement

        – Arne
        May 2 at 14:00




        2




        2





        yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

        – Arne
        May 2 at 14:05






        yes, if you build your code into a package and have set up setup.py correctly by giving it all the dependencies in its setup('requires'=[...]) field, they will be fetched automatically if you try to install your package

        – Arne
        May 2 at 14:05





        1




        1





        @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

        – MilkyWay90
        May 2 at 23:49





        @Kepler186 And if the end user uses pip3 instead? Or if they use python -m pip instead (because pip isn't in the environment variables)? There are many flaws with your os approach.

        – MilkyWay90
        May 2 at 23:49













        5














        To show other users, what libraries are needed for your project, you have multiple options. All options are some kind of files, that say which libraries are needed for this project.



        Files that I am aware of




        • requirements.txt: very simple


        • setup.py: Used when you publish your project on sides like pypi https://stackoverflow.com/a/1472014/8411228


        • Pipfile: The way to go when you work in an virtualenv https://docs.pipenv.org/en/latest/


        • environment.yml: Used for Conda environments https://tdhopper.com/blog/my-python-environment-workflow-with-conda/#fn:requirements-conda





        share|improve this answer



























          5














          To show other users, what libraries are needed for your project, you have multiple options. All options are some kind of files, that say which libraries are needed for this project.



          Files that I am aware of




          • requirements.txt: very simple


          • setup.py: Used when you publish your project on sides like pypi https://stackoverflow.com/a/1472014/8411228


          • Pipfile: The way to go when you work in an virtualenv https://docs.pipenv.org/en/latest/


          • environment.yml: Used for Conda environments https://tdhopper.com/blog/my-python-environment-workflow-with-conda/#fn:requirements-conda





          share|improve this answer

























            5












            5








            5







            To show other users, what libraries are needed for your project, you have multiple options. All options are some kind of files, that say which libraries are needed for this project.



            Files that I am aware of




            • requirements.txt: very simple


            • setup.py: Used when you publish your project on sides like pypi https://stackoverflow.com/a/1472014/8411228


            • Pipfile: The way to go when you work in an virtualenv https://docs.pipenv.org/en/latest/


            • environment.yml: Used for Conda environments https://tdhopper.com/blog/my-python-environment-workflow-with-conda/#fn:requirements-conda





            share|improve this answer













            To show other users, what libraries are needed for your project, you have multiple options. All options are some kind of files, that say which libraries are needed for this project.



            Files that I am aware of




            • requirements.txt: very simple


            • setup.py: Used when you publish your project on sides like pypi https://stackoverflow.com/a/1472014/8411228


            • Pipfile: The way to go when you work in an virtualenv https://docs.pipenv.org/en/latest/


            • environment.yml: Used for Conda environments https://tdhopper.com/blog/my-python-environment-workflow-with-conda/#fn:requirements-conda






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 2 at 13:28









            Uli SotschokUli Sotschok

            648114




            648114





















                3














                Another option: You can use PyInstaller to freeze (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.



                PyInstaller Quickstart



                This has worked very well for me. Indeed, you do not have to worry about whether the final user has Python installed.






                share|improve this answer



























                  3














                  Another option: You can use PyInstaller to freeze (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.



                  PyInstaller Quickstart



                  This has worked very well for me. Indeed, you do not have to worry about whether the final user has Python installed.






                  share|improve this answer

























                    3












                    3








                    3







                    Another option: You can use PyInstaller to freeze (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.



                    PyInstaller Quickstart



                    This has worked very well for me. Indeed, you do not have to worry about whether the final user has Python installed.






                    share|improve this answer













                    Another option: You can use PyInstaller to freeze (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.



                    PyInstaller Quickstart



                    This has worked very well for me. Indeed, you do not have to worry about whether the final user has Python installed.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 2 at 16:18









                    user11293039user11293039

                    311




                    311





















                        1














                        Here is where packaging a python project into a module comes handy modules
                        We include a requirements.txt file which contains all python module requirements needed for that python library, and installs them automatically when the module is setup.



                        A good primer on how to setup your module to be distributable is Structuring your project






                        share|improve this answer

























                        • Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

                          – 3UqU57GnaX
                          May 2 at 13:24











                        • Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

                          – Devesh Kumar Singh
                          May 2 at 13:25















                        1














                        Here is where packaging a python project into a module comes handy modules
                        We include a requirements.txt file which contains all python module requirements needed for that python library, and installs them automatically when the module is setup.



                        A good primer on how to setup your module to be distributable is Structuring your project






                        share|improve this answer

























                        • Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

                          – 3UqU57GnaX
                          May 2 at 13:24











                        • Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

                          – Devesh Kumar Singh
                          May 2 at 13:25













                        1












                        1








                        1







                        Here is where packaging a python project into a module comes handy modules
                        We include a requirements.txt file which contains all python module requirements needed for that python library, and installs them automatically when the module is setup.



                        A good primer on how to setup your module to be distributable is Structuring your project






                        share|improve this answer















                        Here is where packaging a python project into a module comes handy modules
                        We include a requirements.txt file which contains all python module requirements needed for that python library, and installs them automatically when the module is setup.



                        A good primer on how to setup your module to be distributable is Structuring your project







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited May 2 at 13:26

























                        answered May 2 at 13:22









                        Devesh Kumar SinghDevesh Kumar Singh

                        8,8531728




                        8,8531728












                        • Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

                          – 3UqU57GnaX
                          May 2 at 13:24











                        • Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

                          – Devesh Kumar Singh
                          May 2 at 13:25

















                        • Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

                          – 3UqU57GnaX
                          May 2 at 13:24











                        • Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

                          – Devesh Kumar Singh
                          May 2 at 13:25
















                        Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

                        – 3UqU57GnaX
                        May 2 at 13:24





                        Just a requirements.txt is not enough right? I think you also need an __init__.py, setup.py and maybe more. docs.python-guide.org/writing/structure

                        – 3UqU57GnaX
                        May 2 at 13:24













                        Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

                        – Devesh Kumar Singh
                        May 2 at 13:25





                        Yes, the question was about how to installed required libraries, which are listed in requirements.txt, and on top of it, we have these things you mentioned!

                        – Devesh Kumar Singh
                        May 2 at 13:25











                        1














                        So you made a package. Now you will want to share it. What next?



                        Developer



                        Goal - make a distribution (also called a "package") to share



                        Preamble



                        You are now packaging your package and wish to distribute it. There are two main kinds of packages:



                        • an application: deploy a source to a server, github, website e.g. CLI

                        • a library: publish a source distribution (sdist) or binary (e.g. wheel) usually to PyPI via twine

                        Traditional Ways



                        Several files may be included in a distribution, but here are the main ones:



                        • source: your code


                        • setup.py: specify metadata, and dependencies required to make an sdist.


                        • requirements.txt: a list of dependencies

                        Contemporary Ways



                        Use pyproject.toml to specify which tool to use in creating your sdist or binary:



                        Modern tools to create + deploy/publish a package include:




                        1. pipenv: makes a package and substitutes requirements.txt (recommended by PyPA)

                          • develop: > pipenv install <dependency>, > pipenv install

                          • publish: > pipenv -e . + twine



                        2. poetry: makes a package and publishes to PyPI

                          • develop > poetry add <dependency>, > poetry install

                          • publish: > poetry publish



                        3. flit: makes a package and publishes to PyPI

                          • develop: > flit install

                          • publish: > flit publish


                        The first two options have features to make clean virtual environments and safely install dependencies using lock files. I would encourage exploring these newer options later on as they clear up a lot of packaging headaches by obviating setup.py and setuptools.




                        User



                        Goal - get a package and install it with dependencies



                        Traditional Ways



                        Applications have a variety of deployment methods, e.g. uploading your app to a hosting service e.g. heroku, DigitalOcean, etc. The user may indirectly interface with your app through a website, CLI or more.



                        Libraries are often uploaded to PyPI. From here the user can usually install a package using pip independent from how they are made:




                        • > pip install <package> (recommended)


                        • > pip install <packatge> -r requirements (explicit, optional)

                        These commandline invocations will fetch the distribution from PyPI, install the package and specified dependencies.



                        Contemporary Ways



                        Here are some alternatives to pip:




                        1. pipx: "safely" install packages in isolated environments

                          • > pipx install <package>


                        See Also




                        • Official docs on publishing packages by PyPA


                        • Tutorial on How To Package Your Python Code


                        • Podcast interview with B. Cannon on pyproject.toml and modern packaging tools





                        share|improve this answer





























                          1














                          So you made a package. Now you will want to share it. What next?



                          Developer



                          Goal - make a distribution (also called a "package") to share



                          Preamble



                          You are now packaging your package and wish to distribute it. There are two main kinds of packages:



                          • an application: deploy a source to a server, github, website e.g. CLI

                          • a library: publish a source distribution (sdist) or binary (e.g. wheel) usually to PyPI via twine

                          Traditional Ways



                          Several files may be included in a distribution, but here are the main ones:



                          • source: your code


                          • setup.py: specify metadata, and dependencies required to make an sdist.


                          • requirements.txt: a list of dependencies

                          Contemporary Ways



                          Use pyproject.toml to specify which tool to use in creating your sdist or binary:



                          Modern tools to create + deploy/publish a package include:




                          1. pipenv: makes a package and substitutes requirements.txt (recommended by PyPA)

                            • develop: > pipenv install <dependency>, > pipenv install

                            • publish: > pipenv -e . + twine



                          2. poetry: makes a package and publishes to PyPI

                            • develop > poetry add <dependency>, > poetry install

                            • publish: > poetry publish



                          3. flit: makes a package and publishes to PyPI

                            • develop: > flit install

                            • publish: > flit publish


                          The first two options have features to make clean virtual environments and safely install dependencies using lock files. I would encourage exploring these newer options later on as they clear up a lot of packaging headaches by obviating setup.py and setuptools.




                          User



                          Goal - get a package and install it with dependencies



                          Traditional Ways



                          Applications have a variety of deployment methods, e.g. uploading your app to a hosting service e.g. heroku, DigitalOcean, etc. The user may indirectly interface with your app through a website, CLI or more.



                          Libraries are often uploaded to PyPI. From here the user can usually install a package using pip independent from how they are made:




                          • > pip install <package> (recommended)


                          • > pip install <packatge> -r requirements (explicit, optional)

                          These commandline invocations will fetch the distribution from PyPI, install the package and specified dependencies.



                          Contemporary Ways



                          Here are some alternatives to pip:




                          1. pipx: "safely" install packages in isolated environments

                            • > pipx install <package>


                          See Also




                          • Official docs on publishing packages by PyPA


                          • Tutorial on How To Package Your Python Code


                          • Podcast interview with B. Cannon on pyproject.toml and modern packaging tools





                          share|improve this answer



























                            1












                            1








                            1







                            So you made a package. Now you will want to share it. What next?



                            Developer



                            Goal - make a distribution (also called a "package") to share



                            Preamble



                            You are now packaging your package and wish to distribute it. There are two main kinds of packages:



                            • an application: deploy a source to a server, github, website e.g. CLI

                            • a library: publish a source distribution (sdist) or binary (e.g. wheel) usually to PyPI via twine

                            Traditional Ways



                            Several files may be included in a distribution, but here are the main ones:



                            • source: your code


                            • setup.py: specify metadata, and dependencies required to make an sdist.


                            • requirements.txt: a list of dependencies

                            Contemporary Ways



                            Use pyproject.toml to specify which tool to use in creating your sdist or binary:



                            Modern tools to create + deploy/publish a package include:




                            1. pipenv: makes a package and substitutes requirements.txt (recommended by PyPA)

                              • develop: > pipenv install <dependency>, > pipenv install

                              • publish: > pipenv -e . + twine



                            2. poetry: makes a package and publishes to PyPI

                              • develop > poetry add <dependency>, > poetry install

                              • publish: > poetry publish



                            3. flit: makes a package and publishes to PyPI

                              • develop: > flit install

                              • publish: > flit publish


                            The first two options have features to make clean virtual environments and safely install dependencies using lock files. I would encourage exploring these newer options later on as they clear up a lot of packaging headaches by obviating setup.py and setuptools.




                            User



                            Goal - get a package and install it with dependencies



                            Traditional Ways



                            Applications have a variety of deployment methods, e.g. uploading your app to a hosting service e.g. heroku, DigitalOcean, etc. The user may indirectly interface with your app through a website, CLI or more.



                            Libraries are often uploaded to PyPI. From here the user can usually install a package using pip independent from how they are made:




                            • > pip install <package> (recommended)


                            • > pip install <packatge> -r requirements (explicit, optional)

                            These commandline invocations will fetch the distribution from PyPI, install the package and specified dependencies.



                            Contemporary Ways



                            Here are some alternatives to pip:




                            1. pipx: "safely" install packages in isolated environments

                              • > pipx install <package>


                            See Also




                            • Official docs on publishing packages by PyPA


                            • Tutorial on How To Package Your Python Code


                            • Podcast interview with B. Cannon on pyproject.toml and modern packaging tools





                            share|improve this answer















                            So you made a package. Now you will want to share it. What next?



                            Developer



                            Goal - make a distribution (also called a "package") to share



                            Preamble



                            You are now packaging your package and wish to distribute it. There are two main kinds of packages:



                            • an application: deploy a source to a server, github, website e.g. CLI

                            • a library: publish a source distribution (sdist) or binary (e.g. wheel) usually to PyPI via twine

                            Traditional Ways



                            Several files may be included in a distribution, but here are the main ones:



                            • source: your code


                            • setup.py: specify metadata, and dependencies required to make an sdist.


                            • requirements.txt: a list of dependencies

                            Contemporary Ways



                            Use pyproject.toml to specify which tool to use in creating your sdist or binary:



                            Modern tools to create + deploy/publish a package include:




                            1. pipenv: makes a package and substitutes requirements.txt (recommended by PyPA)

                              • develop: > pipenv install <dependency>, > pipenv install

                              • publish: > pipenv -e . + twine



                            2. poetry: makes a package and publishes to PyPI

                              • develop > poetry add <dependency>, > poetry install

                              • publish: > poetry publish



                            3. flit: makes a package and publishes to PyPI

                              • develop: > flit install

                              • publish: > flit publish


                            The first two options have features to make clean virtual environments and safely install dependencies using lock files. I would encourage exploring these newer options later on as they clear up a lot of packaging headaches by obviating setup.py and setuptools.




                            User



                            Goal - get a package and install it with dependencies



                            Traditional Ways



                            Applications have a variety of deployment methods, e.g. uploading your app to a hosting service e.g. heroku, DigitalOcean, etc. The user may indirectly interface with your app through a website, CLI or more.



                            Libraries are often uploaded to PyPI. From here the user can usually install a package using pip independent from how they are made:




                            • > pip install <package> (recommended)


                            • > pip install <packatge> -r requirements (explicit, optional)

                            These commandline invocations will fetch the distribution from PyPI, install the package and specified dependencies.



                            Contemporary Ways



                            Here are some alternatives to pip:




                            1. pipx: "safely" install packages in isolated environments

                              • > pipx install <package>


                            See Also




                            • Official docs on publishing packages by PyPA


                            • Tutorial on How To Package Your Python Code


                            • Podcast interview with B. Cannon on pyproject.toml and modern packaging tools






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited May 4 at 21:59

























                            answered May 3 at 19:40









                            pylangpylang

                            14.9k24558




                            14.9k24558



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • 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%2fstackoverflow.com%2fquestions%2f55953391%2fwhat-if-the-end-user-didnt-have-the-required-library%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