pipreqs | Generate pip requirements.txt file | Build Tool library

 by   bndr Python Version: 0.5.0 License: Apache-2.0

kandi X-RAY | pipreqs Summary

kandi X-RAY | pipreqs Summary

pipreqs is a Python library typically used in Utilities, Build Tool applications. pipreqs has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install pipreqs' or download it from GitHub, PyPI.

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pipreqs has a medium active ecosystem.
              It has 5130 star(s) with 344 fork(s). There are 61 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 132 open issues and 97 have been closed. On average issues are closed in 408 days. There are 33 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pipreqs is 0.5.0

            kandi-Quality Quality

              pipreqs has 0 bugs and 11 code smells.

            kandi-Security Security

              pipreqs has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pipreqs code analysis shows 0 unresolved vulnerabilities.
              There are 1 security hotspots that need review.

            kandi-License License

              pipreqs is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pipreqs releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              pipreqs saves you 254 person hours of effort in developing the same functionality from scratch.
              It has 618 lines of code, 35 functions and 11 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pipreqs and discovered the below as its top functions. This is intended to give you an instant insight into pipreqs implemented functionality, and help decide if they suit your requirements.
            • Clean out imported modules
            • Parse a requirements file
            • Return the set of modules that are not imported
            • Output requirements file
            • Open a file - like object
            • Generate a requirements file
            • Get all imported imports
            • Return the path to a file
            • Get a list of installed packages
            • Return a dict of all installed installed packages
            • Returns a set of package names
            • Show differences between imported modules
            Get all kandi verified functions for this library.

            pipreqs Key Features

            No Key Features are available at this moment for pipreqs.

            pipreqs Examples and Code Snippets

            DiSCoVeR,Citing
            Pythondot img1Lines of Code : 24dot img1License : Permissive (MIT)
            copy iconCopy
            @article{bairdDiSCoVeRMaterialsDiscovery2022,
              title = {{{DiSCoVeR}}: A {{Materials Discovery Screening Tool}} for {{High Performance}}, {{Unique Chemical Compositions}}},
              shorttitle = {{{DiSCoVeR}}},
              author = {Baird, Sterling Gregory and Diep,   
            copy iconCopy
            name: Integration Test
            on: [push]
            jobs:
              build:
                runs-on: ubuntu-latest
                steps:
                  - uses: actions/checkout@master
                  - name: Self test
                    id: selftest
            
                    uses: ryan-rozario/pipreqs-action-cpy@master
            
                    # Put an example   
            Licenses - Requirements
            Pythondot img3Lines of Code : 7dot img3License : Non-SPDX (NOASSERTION)
            copy iconCopy
            pip-licenses -p pyproj geopandas Fiona haversine pandas Shapely
            
            Fiona      1.8.21   BSD License 
            Shapely    1.8.2    BSD License 
            geopandas  0.10.2   BSD         
            haversine  2.5.1    MIT License 
            pandas     1.4.2    BSD License 
            pyproj     3.3.1      
            Docker build(python image) fails due to cryptography
            Pythondot img4Lines of Code : 10dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            RUN apk add --no-cache \
                libressl-dev \
                musl-dev \
                libffi-dev && \
            pip install --no-cache-dir cryptography==2.8 && \
            apk del \
                libressl-dev \
                musl-dev \
                libffi-dev
            
            Docker build(python image) fails due to cryptography
            Pythondot img5Lines of Code : 14dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            Unable to execute 'gcc': No such file or directory
            error: command 'gcc' failed with exit status 1
            
            FROM python:3.8.10-alpine3.13
            RUN apk add --no-cache \
                build-base \
                libressl-dev \
                musl-dev \
                libffi
            How to create a python program where some libraries are automatically installed
            Pythondot img6Lines of Code : 6dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            $ pip install pipreqs 
            
            $ pipreq .
            
            $ pip install -r requirements.txt
            
            How to install python3.9 with conda?
            Pythondot img7Lines of Code : 20dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            conda create -n py39 python=3.9
            
            py39 - environment name
            
            python3.7          
            python3.7-config   
            python3.7m         
            python3.7m-config  
            python3.9          
            python3.9-config
            
            Pipreqs requirements.txt is not correct
            Pythondot img8Lines of Code : 10dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            MyProject
             |- .venv   // <- My Python Virtual Environment
             |- test.py
            
            pipreqs ./
            
            pipreqs ./ --ignore .venv
            
            selenium==3.141.0
            
            Python disable logging for command line module
            Pythondot img9Lines of Code : 6dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            subprocess.call(
              ["pipreqs", "--force","/path/to/dir"],
              stdout=subprocess.DEVNULL,
              stderr=subprocess.DEVNULL
            )
            
            cairocffi install failed on Ubuntu 18.04
            Pythondot img10Lines of Code : 24dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            >>pip3 show cairocffi
            Name: cairocffi
            **Version: file-.cairocffi-VERSION**
            Summary: cffi-based cairo bindings for Python
            Home-page: https://github.com/Kozea/cairocffi
            Author: Simon Sapin
            Author-email: community@kozea.fr
            License: BSD
            

            Community Discussions

            QUESTION

            Pipreqs generate incorrect requiremnets for Hydra
            Asked 2021-Apr-10 at 09:39

            I'm using pipreqs for generating requirements.txt. I started using hydra package (see https://hydra.cc/ or hydra-core package on PyPI). So I would like pipreqs to add hydra-core dependency automatically when I run.

            But, when I checked output of pipreqs (directly in requirements.txt when running pipreqs --force or from console output with pipreqs --print) there is Hydra==2.5. But it's incorrect package (leading to Hydra which is package with a high performance bloom filter). I would expect to see hydra-core==1.0.6 which is the right version of my hydra (hydra-core to be correct) package.

            Is there anything what should I do differently? Or is there any issue with pipreqs?

            • Python 3.8.6
            • pipreqs version: 0.4.10
            ...

            ANSWER

            Answered 2021-Apr-10 at 09:39

            Unfortunately the Hydra package, first released at 2010 - predated the Hydra Framework, so I was not able to use name hydra as the pypi package name (hence hydra-core). I even reached out to the owner of that project, politely asking if he can let go of that name. I was not surprised when he declined :).

            Installing hydra instead of hydra-core is pretty common mistake for people getting started with Hydra.

            Looking at that project, they do have a mechanism to help indicate what package to use when seeing an import, which might be helpful. See this PR for example. You may want to open a pull request to add hydra-core to their mapping. Given that hydra-core is much more popular than the other hydra, I think they will be okay with it.

            Source https://stackoverflow.com/questions/67022499

            QUESTION

            Pipreqs requirements.txt is not correct
            Asked 2020-Nov-01 at 08:52

            Hello I am having troubles with the pipreqs librairy in Python. It doesn't generate the correct requirements.txt file. I am using a Python Virtual Environment and the only packages I have installed are pipreqs and selenium with

            ...

            ANSWER

            Answered 2020-Nov-01 at 08:52

            So the issue I had was that my actual workspace was:

            Source https://stackoverflow.com/questions/64630130

            QUESTION

            Python disable logging for command line module
            Asked 2020-Jun-27 at 20:07

            What I'm trying to do seems really simple but I can't find a way to do it. I'm trying to use the module Pipreqs in a script, but I have to use subprocess.call() because Pipreqs doesn't have a way to use it in a script. Pipreqs uses logging to log info and I don't want that. Pipreqs also doesn't have a quiet mode. I tried to use logger.setLevel(logging.WARNING) but since I'm calling it through subprocess.call() it still prints info. I've also tried importing Pipreqs and setting the logging level to warning and that also doesn't work. Is there any way to disable this output? My code right now is the following:

            ...

            ANSWER

            Answered 2020-Jun-27 at 20:07

            You won't have access to the logger for an external process. The subprocess module does have flags for disabling output though.

            Source https://stackoverflow.com/questions/62614938

            QUESTION

            Pipreqs: UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 1206: character maps to
            Asked 2020-May-26 at 12:06

            When i use pipreqs, i have this problem, i use anaconda and Russian Windows.

            ...

            ANSWER

            Answered 2020-May-26 at 12:06

            You can pass an encoding argument to pipreqs to set the encoding to use to open files.

            Python3 files are usually encoded as utf-8, so execute

            pipreqs --encoding=utf8 C:\Users\root\Desktop\resumes

            Source https://stackoverflow.com/questions/51503913

            QUESTION

            Robust way to ensure other people can run my python program
            Asked 2020-Apr-08 at 14:14

            I wish to place a python program on GitHub and have other people download and run it on their computers with assorted operating systems. I am relatively new to python but have used it enough to have noticed that getting the assorted versions of all the included modules to work together can be problematic. I just discovered the use of requirements.txt (generated with pipreqs and deployed with the command pip install -r /path/to/requirements.txt) but was very surprised to notice that requirements.txt does not actually state what version of python is being used so obviously it is not the complete solution on its own. So my question is: what set of specifications/files/something-else is needed to ensure that someone downloading my project will actually be able to run it with the fewest possible problems.

            EDIT: My plan was to be guided by whichever answer got the most upvotes. But so far, after 4 answers and 127 views, not a single answer has even one upvote. If some of the answers are no good, it would be useful to see some comments as to why they are no good.

            ...

            ANSWER

            Answered 2020-Apr-06 at 07:58

            If your program is less about GUI, or has a web GUI, then you can share the code using Google Colaboratory.

            https://colab.research.google.com/

            Everyone can run it with the same environment. No need for installation.

            Source https://stackoverflow.com/questions/60928734

            QUESTION

            Installing packages from requirements.txt in github repo
            Asked 2019-Nov-22 at 15:00

            I am trying to pip install packages from a requirements file I generated using pipreqs.

            However I keep encountering this error message:

            ...

            ANSWER

            Answered 2019-Nov-22 at 15:00

            -r to install requirements. git+ is only needed if you are trying to install a package from a git repo, however you have a direct link to the file, so remove that.

            Source https://stackoverflow.com/questions/58996546

            QUESTION

            Windows: Get all modules/packages used by a python project
            Asked 2019-Apr-13 at 23:36

            I have an application and now I would like to know what packages/modules are necessary if someone else wants to install it. How can I get all the python modules/packages that are needed for a specific project?

            Important Note: This question was already answered for Linux. They suggested pipreqs, which seems like a great solution, however it does not to support Windows.

            My Python version is 3.6.4.

            I am working on windows 10.

            ...

            ANSWER

            Answered 2019-Apr-13 at 23:36

            Maybe you could use: pip freeze ?

            This would output all the installed packages for your given project, for reference.

            Hopefully that helps!

            Source https://stackoverflow.com/questions/52504092

            QUESTION

            Generate requirements.txt from uninstalled wheel
            Asked 2019-Mar-07 at 02:18

            I'm trying to generate a list of requirements from a local uninstalled wheel. Simply getting the list that was fed as the packages parameter into setup.py's setuptools.setup-call would be optimal. The output that a pip freeze would generate if the wheel were installed could work, too.

            Slightly more context

            I want to build a docker image that is going to be used in a CI chain. In order to cut down on pipeline time, it should come front-loaded with all runtime dependencies. But at the point where the image is built, the python package is not built yet, and building the package outside of the chain merely for obtaining a requirements.txt is cumbersome and error-prone.

            Things I tried

            Hacking it into the Dockerfile:

            ...

            ANSWER

            Answered 2019-Mar-07 at 02:18

            My project johnnydep has precisely this feature for generating dependencies from an uninstalled wheel file.

            Source https://stackoverflow.com/questions/52478039

            QUESTION

            How do I configure PATH variables so I can run packages on the CLI?
            Asked 2019-Mar-06 at 01:06

            I have Python 3.7 installed on my Mac and installed the package pipreqs with the command pip3 install pipreqs --user.

            When I try to run pipreqs path/to/file I get an -bash: pipreqs: command not found error.

            I get that it's looking in the wrong place, which is why the package can't be found.

            I've been seeing a few posts like this helping people reset their paths. I really have no idea where to start. Is this something I can just do from the command line, or do I actually have to edit a file using vim or something. Do I ~/.bashrc directly?

            When I run run echo $path I get

            /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dev/opt/bin:/Users/dev/opt/bin:/Users/dev/dev/bin:/Users/dev/.local/bin My username is dev.

            EDIT:

            ...

            ANSWER

            Answered 2019-Mar-01 at 06:25

            QUESTION

            Recreate Local Python Environment in Remote Server
            Asked 2018-May-06 at 18:20

            I am currently using conda for this purpose.

            After generating local environment.yml, I run $ conda create -n environment.yml on the remote server.

            But this doesn't include global packages that my code references.

            I can add a requirements.txt using pipreqs and then run pip install -r requirements.txt remotely but this doesn't take into account dependencies like dlib or boost that a package may need for installation.

            Is there any solution for this?

            ...

            ANSWER

            Answered 2018-May-06 at 18:20

            You have two diff type of dependencies. 1) Need to install via apt-get like boost, opencv 2) Need to install via pip.

            You need to install apt-get library manually on the server and can define pip related libraries in the requirements.txt file. Because apt-get libraries are environment independent.

            Source https://stackoverflow.com/questions/50202864

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pipreqs

            You can install using 'pip install pipreqs' or download it from GitHub, PyPI.
            You can use pipreqs like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install pipreqs

          • CLONE
          • HTTPS

            https://github.com/bndr/pipreqs.git

          • CLI

            gh repo clone bndr/pipreqs

          • sshUrl

            git@github.com:bndr/pipreqs.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link