如何判断django项目引入了哪些依赖库?
本地主机已经安装了多个django项目的依赖库,现在在别的主机上要运行一个项目。
ps:如果使用pip freeze>requirments.txt的方式是将所有依赖库重新安装一遍。
回答:
正常是应该一个项目一个Python虚拟环境,然后使用pip freeze
。
你目前的情况,可以新建一个Python虚拟环境,然后使用该虚拟环境一个个找出依赖库,在虚拟环境中pip freeze
吧。
回答:
Installation
pip install pipreqs
Usage
Usage:
pipreqs [options] <path>
Options:
--use-local Use ONLY local package info instead of querying PyPI--pypi-server <url> Use custom PyPi server
--proxy <url> Use Proxy, parameter will be passed to requests library. You can also just set the
environments parameter in your terminal:
$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="https://10.10.1.10:1080"
--debug Print debug information
--ignore <dirs>... Ignore extra directories
--encoding <charset> Use encoding parameter for file open
--savepath <file> Save the list of requirements in the given file
--print Output the list of requirements in the standard output
--force Overwrite existing requirements.txt
--diff <file> Compare modules in requirements.txt to project imports.
--clean <file> Clean up requirements.txt by removing modules that are not imported in project.
Example
$ pipreqs /home/project/location
Successfully saved requirements file in /home/project/location/requirements.txt
reference: https://github.com/jiangbingo...
以上是 如何判断django项目引入了哪些依赖库? 的全部内容, 来源链接: utcz.com/a/164119.html