Anaconda创建跟别人环境配置一样的虚拟环境(coda env creat -f environment.yml)

举报
小小谢先生 发表于 2022/04/16 03:09:24 2022/04/16
【摘要】 当我们跑别人在github上的代码时,往往需要配置跟作者一样的环境。当作者导出自己的环境配置时,一般都是.yml文件,这时候需要输入命令行来实现配置一模一样的环境。 导出的yml文件一般配置如下: name: vin_old_tfchannels: - anaconda - intel - conda-forge - def...

当我们跑别人在github上的代码时,往往需要配置跟作者一样的环境。当作者导出自己的环境配置时,一般都是.yml文件,这时候需要输入命令行来实现配置一模一样的环境。

导出的yml文件一般配置如下:


  
  1. name: vin_old_tf
  2. channels:
  3. - anaconda
  4. - intel
  5. - conda-forge
  6. - defaults
  7. dependencies:
  8. - _libgcc_mutex=0.1=main
  9. - _tflow_select=2.1.0=gpu
  10. - absl-py=0.8.1=py37_0
  11. - astor=0.8.0=py37_0
  12. - attrs=19.3.0=py_0
  13. - backcall=0.1.0=py37_0
  14. - binutils_impl_linux-64=2.31.1=h6176602_1
  15. - binutils_linux-64=2.31.1=h6176602_9
  16. - blas=2.14=openblas
  17. - bleach=3.1.0=py37_0
  18. - bzip2=1.0.8=h7b6447c_0
  19. - c-ares=1.15.0=h7b6447c_1001
  20. - ca-certificates=2020.7.22=0
  21. - cairo=1.16.0=hfb77d84_1002
  22. - certifi=2020.6.20=py37_0
  23. - cloudpickle=1.2.2=py_1
  24. - coloredlogs=14.0=py37hc8dfbb8_1
  25. - cudatoolkit=10.0.130=0
  26. - cudnn=7.6.5=cuda10.0_0
  27. - cupti=10.0.130=0
  28. - cycler=0.10.0=py_2
  29. - cytoolz=0.10.1=py37h516909a_0
  30. - dask-core=2.9.2=py_0
  31. - dbus=1.13.12=h746ee38_0
  32. - decorator=4.4.1=py_0
  33. - defusedxml=0.6.0=py_0
  34. - entrypoints=0.3=py37_0
  35. - expat=2.2.9=he1b5a44_2
  36. - ffmpeg=4.1.3=h167e202_0
  37. - fontconfig=2.13.1=h86ecdb6_1001
  38. - freetype=2.9.1=h8a8886c_1
  39. - gast=0.3.2=py_0
  40. - gcc_impl_linux-64=7.3.0=habb00fd_1
  41. - gcc_linux-64=7.3.0=h553295d_9
  42. - giflib=5.2.1=h516909a_1
  43. - glib=2.63.1=h5a9c865_0
  44. - gmp=6.1.2=h6c8ec71_1
  45. - gnutls=3.6.5=hd3a4fd2_1002
  46. - google-pasta=0.1.8=py_0
  47. - graphite2=1.3.13=h23475e2_0
  48. - grpcio=1.16.1=py37hf8bcb03_1
  49. - gst-plugins-base=1.14.5=h0935bb2_0
  50. - gstreamer=1.14.5=h36ae1b5_0
  51. - gxx_impl_linux-64=7.3.0=hdf63c60_1
  52. - gxx_linux-64=7.3.0=h553295d_9
  53. - h5py=2.10.0=nompi_py37h513d04c_101
  54. - harfbuzz=2.4.0=h9f30f68_3
  55. - hdf5=1.10.5=nompi_h3c11f04_1104
  56. - humanfriendly=8.2=py37hc8dfbb8_0
  57. - icu=64.2=he1b5a44_1
  58. - imageio=2.6.1=py37_0
  59. - imbalanced-learn=0.6.2=py_0
  60. - importlib_metadata=1.3.0=py37_0
  61. - intelpython=2020.0=1
  62. - ipykernel=5.1.3=py37h39e3cac_1
  63. - ipython=7.11.1=py37h39e3cac_0
  64. - ipython_genutils=0.2.0=py37_0
  65. - ipywidgets=7.5.1=py_0
  66. - jasper=1.900.1=hd497a04_4
  67. - jedi=0.15.2=py37_0
  68. - jinja2=2.10.3=py_0
  69. - joblib=0.13.2=py37_1
  70. - jpeg=9c=h14c3975_1001
  71. - jsonschema=3.2.0=py37_0
  72. - jupyter=1.0.0=py37_7
  73. - jupyter_client=5.3.4=py37_0
  74. - jupyter_console=6.1.0=py_0
  75. - jupyter_core=4.6.1=py37_0
  76. - keras=2.3.1=py37_0
  77. - keras-applications=1.0.8=py_0
  78. - keras-preprocessing=1.1.0=py_1
  79. - kiwisolver=1.1.0=py37hc9558a2_0
  80. - lame=3.100=h7b6447c_0
  81. - ld_impl_linux-64=2.33.1=h53a641e_7
  82. - libblas=3.8.0=14_openblas
  83. - libcblas=3.8.0=14_openblas
  84. - libclang=9.0.1=default_hde54327_0
  85. - libedit=3.1.20181209=hc058e9b_0
  86. - libffi=3.2.1=hd88cf55_4
  87. - libgcc-ng=9.1.0=hdf63c60_0
  88. - libgfortran-ng=7.3.0=hdf63c60_0
  89. - libgpuarray=0.7.6=h14c3975_1003
  90. - libiconv=1.15=h63c8f33_5
  91. - liblapack=3.8.0=14_openblas
  92. - liblapacke=3.8.0=14_openblas
  93. - libllvm9=9.0.1=hc9558a2_0
  94. - libopenblas=0.3.7=h5ec1e0e_6
  95. - libopencv=4.2.0=py37_2
  96. - libpng=1.6.37=hbc83047_0
  97. - libprotobuf=3.11.2=hd408876_0
  98. - libsodium=1.0.16=h1bed415_0
  99. - libstdcxx-ng=9.1.0=hdf63c60_0
  100. - libtiff=4.1.0=h2733197_0
  101. - libuuid=2.32.1=h14c3975_1000
  102. - libwebp=1.0.2=h56121f0_5
  103. - libxcb=1.13=h1bed415_1
  104. - libxkbcommon=0.9.1=hebb1f50_0
  105. - libxml2=2.9.9=hea5a465_1
  106. - mako=1.1.0=py_0
  107. - markdown=3.1.1=py37_0
  108. - markupsafe=1.1.1=py37h7b6447c_0
  109. - matplotlib=3.1.2=py37_1
  110. - matplotlib-base=3.1.2=py37h250f245_1
  111. - mistune=0.8.4=py37h7b6447c_0
  112. - more-itertools=8.0.2=py_0
  113. - nbconvert=5.6.1=py37_0
  114. - nbformat=4.4.0=py37_0
  115. - ncurses=6.1=he6710b0_1
  116. - nettle=3.4.1=h1bed415_1002
  117. - networkx=2.4=py_0
  118. - notebook=6.0.2=py37_0
  119. - nspr=4.24=he1b5a44_0
  120. - nss=3.47=he751ad9_0
  121. - numpy=1.16.4=py37h99e49ec_0
  122. - numpy-base=1.16.4=py37h2f8d375_0
  123. - olefile=0.46=py_0
  124. - opencv=4.2.0=py37_2
  125. - openh264=1.8.0=hd408876_0
  126. - openssl=1.1.1g=h7b6447c_0
  127. - pandas=1.0.3=py37h0573a6f_0
  128. - pandoc=2.2.3.2=0
  129. - pandocfilters=1.4.2=py37_1
  130. - parso=0.5.2=py_0
  131. - pcre=8.43=he6710b0_0
  132. - pexpect=4.7.0=py37_0
  133. - pickleshare=0.7.5=py37_0
  134. - pillow=6.0.0=py37h34e0f95_0
  135. - pip=19.3.1=py37_0
  136. - pixman=0.38.0=h7b6447c_0
  137. - prometheus_client=0.7.1=py_0
  138. - prompt_toolkit=3.0.2=py_0
  139. - protobuf=3.11.2=py37he6710b0_0
  140. - ptyprocess=0.6.0=py37_0
  141. - py-opencv=4.2.0=py37h5ca1d4c_2
  142. - pygments=2.5.2=py_0
  143. - pygpu=0.7.6=py37hc1659b7_1000
  144. - pyparsing=2.4.6=py_0
  145. - pyqt=5.12.3=py37h8685d9f_3
  146. - pyrsistent=0.15.6=py37h7b6447c_0
  147. - python=3.7.6=h0371630_2
  148. - python-dateutil=2.8.1=py_0
  149. - python_abi=3.7=1_cp37m
  150. - pytz=2020.1=py_0
  151. - pywavelets=1.1.1=py37hc1659b7_0
  152. - pyyaml=5.3.1=py37h8f50634_0
  153. - pyzmq=18.1.0=py37he6710b0_0
  154. - qt=5.12.5=hd8c4c69_1
  155. - qtconsole=4.6.0=py_1
  156. - readline=7.0=h7b6447c_5
  157. - scikit-image=0.16.2=py37hb3f55d8_0
  158. - scikit-learn=0.22.1=py37h22eb022_0
  159. - scipy=1.3.2=py37he2b7bc3_0
  160. - send2trash=1.5.0=py37_0
  161. - setuptools=44.0.0=py37_0
  162. - six=1.13.0=py37_0
  163. - sqlite=3.30.1=h7b6447c_0
  164. - tensorboard=1.14.0=py37hf484d3e_0
  165. - tensorflow=1.14.0=gpu_py37h4491b45_0
  166. - tensorflow-base=1.14.0=gpu_py37h8d69cac_0
  167. - tensorflow-estimator=1.14.0=py_0
  168. - tensorflow-gpu=1.14.0=h0d30ee6_0
  169. - termcolor=1.1.0=py37_1
  170. - terminado=0.8.3=py37_0
  171. - testpath=0.4.4=py_0
  172. - theano=1.0.4=py37he1b5a44_1001
  173. - tk=8.6.10=hed695b0_0
  174. - toolz=0.10.0=py_0
  175. - tornado=6.0.3=py37h7b6447c_0
  176. - tqdm=4.41.1=py_0
  177. - traitlets=4.3.3=py37_0
  178. - ujson=2.0.3=py37he6710b0_0
  179. - wcwidth=0.1.7=py37_0
  180. - webencodings=0.5.1=py37_1
  181. - werkzeug=0.16.0=py_0
  182. - wheel=0.33.6=py37_0
  183. - widgetsnbextension=3.5.1=py37_0
  184. - wrapt=1.11.2=py37h7b6447c_0
  185. - x264=1!152.20180806=h7b6447c_0
  186. - xorg-kbproto=1.0.7=h14c3975_1002
  187. - xorg-libice=1.0.10=h516909a_0
  188. - xorg-libsm=1.2.3=h84519dc_1000
  189. - xorg-libx11=1.6.9=h516909a_0
  190. - xorg-libxext=1.3.4=h516909a_0
  191. - xorg-libxrender=0.9.10=h516909a_1002
  192. - xorg-renderproto=0.11.1=h14c3975_1002
  193. - xorg-xextproto=7.3.0=h14c3975_1002
  194. - xorg-xproto=7.0.31=h14c3975_1007
  195. - xz=5.2.4=h14c3975_4
  196. - yaml=0.2.5=h516909a_0
  197. - zeromq=4.3.1=he6710b0_3
  198. - zipp=0.6.0=py_0
  199. - zlib=1.2.11=h7b6447c_3
  200. - zstd=1.3.7=h0b5b093_0
  201. - pip:
  202. - dlib==19.19.0
  203. - pyqt5-sip==4.19.18
  204. - pyqtchart==5.12
  205. - pyqtwebengine==5.12.1
  206. prefix: /home/rubin/anaconda3/envs/vin_old_tf

如上述代码所示:name是创建虚拟环境之后在anaconda/envs文件夹下虚拟环境的名称,比如这个为:vin_old_tf;channels、dependents、pip都是需要下载的包名;prefix则是自己anaconda文件下虚拟环境的路径,

需要把这个路径改为自己的文件夹

接下来配置和创建虚拟环境,输入如下命令行

conda env create -f environment.yml
 

然后按enter,系统就开始自动下载啦,等一段时间之后就安装和配置成功了。

PS:看安装成功与否可以看/home/rubin/anaconda3/envs/文件夹下有没有创建的虚拟环境的文件名,有的话就是安装成功了。

文章来源: blog.csdn.net,作者:小小谢先生,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/xiewenrui1996/article/details/110306430

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。