如何导出一个python项目的所有依赖包?
1.基于pip freeze > requrements.txt
该方法获得的依赖包含了项目之外的各种包,不仅仅是本项目的依赖包,对于应用在服务器的部署会成为一个负担,如下是使用该方法获取的某个应用的依赖包截图,大家可对比下一种方法所得到的依赖包:
absl-py==0.13.0
alabaster==0.7.10
alembic==1.7.4
anaconda-client==1.6.14
anaconda-navigator==1.8.7
anaconda-project==0.8.2
app==0.0.1
appdirs==1.4.4
asn1crypto==0.24.0
astroid==1.6.3
astropy==3.0.2
astunparse==1.6.3
attrs==18.1.0
audioread==2.1.9
autopep8==1.6.0
Babel==2.5.3
backcall==0.1.0
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.6.0
bidict==0.21.4
biosppy==0.7.3
bitarray==0.8.1
bkcharts==0.2
blaze==0.11.3
bleach==2.1.3
blurhash==1.1.4
bokeh==0.12.16
boost==0.1
boto==2.48.0
Bottleneck==1.2.1
bs4==0.0.1
cached-property==1.5.2
cachetools==4.2.2
certifi==2021.5.30
cffi==1.11.5
chardet==3.0.4
charset-normalizer==2.0.4
click==8.0.1
cloudpickle==0.5.3
clyent==1.2.2
cmake==3.21.3
colorama==0.4.4
comtypes==1.1.4
conda==4.10.3
conda-build==3.10.5
conda-package-handling @ file:///C:/ci/conda-package-handling_1618262422346/work
conda-verify==2.0.0
config==0.5.1
configparser==5.0.2
contextlib2==0.5.5
cryptography @ file:///C:/ci/cryptography_1615505277812/work
cycler==0.10.0
Cython==0.28.2
cytoolz==0.9.0.1
dask==0.17.5
dataclasses @ file:///tmp/build/80754af9/dataclasses_1614363715916/work
datashape==0.5.4
decorator==4.3.0
dill==0.3.4
distributed==1.21.8
dlib @ file:///C:/Users/JHL2021/Dow