为什么我的evrionment.yaml有这么多依赖项?

2024-09-23 14:25:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我是新来Anaconda的,我有一个项目需要numpy{}和pandas。因此,我卸载了所有以前版本的python,安装了anaconda,并为我的项目创建了一个新的虚拟环境(并激活了它)。在那里,我运行了以下命令:

conda install numpy -y

conda install matplotlib -y

conda install pandas -y

当我运行conda list时,我能够找到所有的。问题是,它们还附带了大量其他依赖项

下面是我的environment.yaml文件中的依赖项的外观:

dependencies:
  - blas=1.0=mkl
  - ca-certificates=2020.7.22=0
  - certifi=2020.6.20=py37_0
  - cycler=0.10.0=py37_0
  - freetype=2.10.3=hd328e21_0
  - icu=58.2=ha925a31_3
  - intel-openmp=2020.2=254
  - jpeg=9b=hb83a4c4_2
  - kiwisolver=1.2.0=py37h74a9793_0
  - libpng=1.6.37=h2a8f88b_0
  - libtiff=4.1.0=h56a325e_1
  - lz4-c=1.9.2=hf4a77e7_3
  - matplotlib=3.3.1=0
  - matplotlib-base=3.3.1=py37hba9282a_0
  - mkl=2020.2=256
  - mkl-service=2.3.0=py37hb782905_0
  - mkl_fft=1.2.0=py37h45dec08_0
  - mkl_random=1.1.1=py37h47e9c7a_0
  - numpy=1.19.1=py37h5510c5b_0
  - numpy-base=1.19.1=py37ha3acd2a_0
  - olefile=0.46=py37_0
  - openssl=1.1.1h=he774522_0
  - pandas=1.1.3=py37ha925a31_0
  - pillow=7.2.0=py37hcc1f983_0
  - pip=20.2.3=py37_0
  - pyparsing=2.4.7=py_0
  - pyqt=5.9.2=py37h6538335_2
  - python=3.7.9=h60c2a47_0
  - python-dateutil=2.8.1=py_0
  - pytz=2020.1=py_0
  - qt=5.9.7=vc14h73c81de_0
  - setuptools=50.3.0=py37h9490d1a_1
  - sip=4.19.8=py37h6538335_0
  - six=1.15.0=py_0
  - sqlite=3.33.0=h2a8f88b_0
  - tk=8.6.10=he774522_0
  - tornado=6.0.4=py37he774522_1
  - vc=14.1=h0510ff6_4
  - vs2015_runtime=14.16.27012=hf0eaf9b_3
  - wheel=0.35.1=py_0
  - wincertstore=0.2=py37_0
  - xz=5.2.5=h62dcd97_0
  - zlib=1.2.11=h62dcd97_4
  - zstd=1.4.5=h04227a9_0

所有这些都是必要的吗?当我查看其他人的environment.yaml文件时,它们看起来总是非常干净,没有所有这些包,尽管仍然有numpymatplotlibpandas


Tags: install文件项目pynumpyyamlpandasbase
1条回答
网友
1楼 · 发布于 2024-09-23 14:25:49

在这个回答中,我将引用“查尔斯·达菲”和“OneCricketeer”:

@Charles Duffy:

That's normal. numpy, matplotlib and pandas have enormous dependency chains. If you're looking at other peoples' files and they don't have them, those people presumably aren't pinning transitive dependencies, but instead letting conda decide at installation time what versions to use. There are defensible reasons to do that, but there are also defensible reasons not to.

@OneCricketeer:

The only one that stands out to me is as not needed is tornado ... blas, intel-openmp, and mkl are "optional" in numpy, but they make it run faster

相关问题 更多 >