Sorry Python but it is what it is.

  • Ascyron
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    Bruh idk why the difference… Educate me?

          • JakobDev@feddit.de
            link
            fedilink
            arrow-up
            8
            ·
            1 year ago

            Yes, but this file is created by you and not pip. It’s not like package.json from npm. You don’t even need to create this file.

            • theFibonacciEffect@feddit.de
              link
              fedilink
              arrow-up
              4
              ·
              1 year ago

              Well if the file would be created by hand, that’s very cumbersome.

              But what is sometimes done to create it automatically is using

              pip freeze > requirements. txt

              inside your virtual environment.

              You said I don’t need to create this file? How else will I distribute my environment so that it can be easily used? There are a lot of other standard, like setup.py etc, so it’s only one possibility. But the fact that there are multiple competing standard shows that how pip handles this is kinds bad.

              • Vash63@lemmy.world
                link
                fedilink
                arrow-up
                3
                ·
                1 year ago

                I work with python professionally and would never do that. I add my actual imports to the requirements and if I forget I do it later as the package fails CI/CD tests.

              • JakobDev@feddit.de
                link
                fedilink
                English
                arrow-up
                2
                ·
                1 year ago

                If you try to keep your depencies low, it’s not very cumbersome. I usually do that.

                A setup.py/pyproject.toml can replace requirements. txt, but it is for creating packages and does way more than just installing dependencies, so they are not really competing.

                For scripts which have just 1 or 2 packges as depencies it’s also usuall to just tell people to run pip install .

          • Farent@lemmy.scam-mail.me
            link
            fedilink
            arrow-up
            7
            ·
            1 year ago

            Isn’t it called a requirements.txt because it’s used to export your project requirements (dependencies), not all packages installed in your local pip environment?

        • theFibonacciEffect@feddit.de
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          1 year ago

          If newer versions are released and dependencies change you would still install the old dependencies. And if the dependencies are not stored you can’t reproduce the exact same environment.

    • ExLisper@linux.communityOP
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 year ago

      cargo just works, it’s great and everyone loves it.

      npm has a lot of issues but in general does the job. When docs say do ‘npm install X’ you do it and it works.

      pip is a mess. In my experience doing ‘pip install X’ will maybe install something but it will not work because some dependencies will be screwed up. Using it to distribute software is pointless.

      • krimson@feddit.nl
        link
        fedilink
        arrow-up
        26
        ·
        1 year ago

        I use pip extensively and have zero issues.

        npm pulls in a million dependencies for even the simplest functionality.

          • krimson@feddit.nl
            link
            fedilink
            arrow-up
            6
            ·
            1 year ago

            Nope. I know mixing pip with python packages installed through your systems package manager can be a problem but that’s why I containerize everything.

            • qaz@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              1 year ago

              I separate everything in virtual environments myself, but in my opinion you shouldn’t need to that to simply avoid breaking your system.

        • ExLisper@linux.communityOP
          link
          fedilink
          English
          arrow-up
          5
          ·
          1 year ago

          It probably works for your own local project. After using it for couple of days to install some 3rd party tool my conclusion is that it has no idea about dependencies. It just downloads some dependencies in some random versions and than it never works. Completely useless.