pipreqs | Generate pip requirements.txt file | Build Tool library
kandi X-RAY | pipreqs Summary
kandi X-RAY | pipreqs Summary
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
Top functions reviewed by kandi - BETA
- 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
pipreqs Key Features
pipreqs Examples and Code Snippets
@article{bairdDiSCoVeRMaterialsDiscovery2022,
title = {{{DiSCoVeR}}: A {{Materials Discovery Screening Tool}} for {{High Performance}}, {{Unique Chemical Compositions}}},
shorttitle = {{{DiSCoVeR}}},
author = {Baird, Sterling Gregory and Diep,
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
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
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
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
$ pip install pipreqs
$ pipreq .
$ pip install -r requirements.txt
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
MyProject
|- .venv // <- My Python Virtual Environment
|- test.py
pipreqs ./
pipreqs ./ --ignore .venv
selenium==3.141.0
subprocess.call(
["pipreqs", "--force","/path/to/dir"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL
)
>>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
Trending Discussions on pipreqs
QUESTION
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:39Unfortunately 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.
QUESTION
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:52So the issue I had was that my actual workspace was:
QUESTION
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:07You won't have access to the logger for an external process. The subprocess module does have flags for disabling output though.
QUESTION
When i use pipreqs, i have this problem, i use anaconda and Russian Windows.
...ANSWER
Answered 2020-May-26 at 12:06You 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
QUESTION
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:58If 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.
QUESTION
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.
QUESTION
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:36Maybe you could use: pip freeze
?
This would output all the installed packages for your given project, for reference.
Hopefully that helps!
QUESTION
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.
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.
Hacking it into the Dockerfile:
...ANSWER
Answered 2019-Mar-07 at 02:18My project johnnydep
has precisely this feature for generating dependencies from an uninstalled wheel file.
QUESTION
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:25Run
QUESTION
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:20You 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pipreqs
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page