手动安装environment.yml的依赖包

2024-09-02 19:52

本文主要是介绍手动安装environment.yml的依赖包,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

在使用environment.yml文件来管理项目依赖的时候,通常我们会使用Anaconda或Miniconda创建一个环境,这样可以确保所有必需的Python包和特定版本都正确安装。下面是如何手动安装environment.yml中定义的依赖包的步骤:

1. 创建一个新的conda环境

首先,你需要有一个名为environment.yml的文件,其中列出了你的所有依赖项及其版本信息。这个文件看起来可能像这样:

name: myprojectenv
dependencies:- python=3.7- numpy- pandas- scipy- pip:- some-python-package # 使用pip安装的包

要创建一个新环境并安装所有的依赖项,你可以在命令行中运行以下命令:

conda env create -f environment.yml

这将根据environment.yml文件创建一个名为myprojectenv的新环境。

2. 激活新环境

创建完环境后,需要激活它才能开始使用:

  • 在Windows上:

    conda activate myprojectenv
    
  • 在Unix或MacOS上:

    source activate myprojectenv
    

或者,在较新的Anaconda版本中,你可以使用conda activate myprojectenv在所有平台上。

3. 手动添加额外的依赖(如果需要)

如果你需要手动添加依赖,可以使用conda installpip install来安装额外的包。例如:

conda install package_name
pip install another_package

4. 查看已安装的包

你可以通过以下命令查看环境中已经安装了哪些包:

conda list

这将显示当前激活环境中的所有包以及它们的版本。

5. 更新环境文件

如果你手动添加了新的依赖项,你应该更新environment.yml文件以包含这些新的依赖项,这样其他人可以根据最新的文件重建相同的环境。

6. 删除环境(可选)

当你不再需要某个环境时,可以删除它:

conda env remove -n myprojectenv

以上就是如何使用environment.yml文件来管理你的Python项目的依赖关系。这种方式有助于确保你的项目能够在不同的机器上一致地运行。

7.实际运行
Ran pip subprocess with arguments:
['E:\\Anaconda\\envs\\nudd-env-offical\\python.exe', '-m', 'pip', 'install', '-U', '-r', 'E:\\RomulusHe\\Projects\\NUDD\\DjangoProDemo-followup\\condaenv.gvwkf7xc.requirements.txt']
Pip subprocess output:
Collecting amqp==5.2.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 1))Using cached amqp-5.2.0-py3-none-any.whl.metadata (8.9 kB)
Collecting apscheduler==3.10.4 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 2))Using cached APScheduler-3.10.4-py3-none-any.whl.metadata (5.7 kB)
Collecting asgiref==3.8.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 3))Using cached asgiref-3.8.1-py3-none-any.whl.metadata (9.3 kB)
Collecting async-timeout==4.0.3 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 4))Using cached async_timeout-4.0.3-py3-none-any.whl.metadata (4.2 kB)
Collecting billiard==4.2.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 5))Using cached billiard-4.2.0-py3-none-any.whl.metadata (4.4 kB)
Collecting celery==5.4.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 6))Using cached celery-5.4.0-py3-none-any.whl.metadata (21 kB)
Collecting certifi==2024.8.30 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 7))Using cached certifi-2024.8.30-py3-none-any.whl.metadata (2.2 kB)
Collecting charset-normalizer==3.3.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 8))Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl.metadata (34 kB)
Collecting click==8.1.7 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 9))Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting click-didyoumean==0.3.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 10))Using cached click_didyoumean-0.3.1-py3-none-any.whl.metadata (3.9 kB)
Collecting click-plugins==1.1.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 11))Using cached click_plugins-1.1.1-py2.py3-none-any.whl.metadata (6.4 kB)
Collecting click-repl==0.3.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 12))Using cached click_repl-0.3.0-py3-none-any.whl.metadata (3.6 kB)
Collecting colorama==0.4.6 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 13))Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting django==5.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 14))Using cached Django-5.1-py3-none-any.whl.metadata (4.2 kB)
Collecting django-apscheduler==0.6.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 15))Using cached django_apscheduler-0.6.2-py3-none-any.whl.metadata (15 kB)
Collecting et-xmlfile==1.1.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 16))Using cached et_xmlfile-1.1.0-py3-none-any.whl.metadata (1.8 kB)
Collecting idna==3.8 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 17))Using cached idna-3.8-py3-none-any.whl.metadata (9.9 kB)
Collecting kombu==5.4.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 18))Using cached kombu-5.4.0-py3-none-any.whl.metadata (3.1 kB)
Collecting mysqlclient==2.2.4 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 19))Using cached mysqlclient-2.2.4-cp310-cp310-win_amd64.whl.metadata (4.6 kB)
Collecting numpy==2.1.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 20))Using cached numpy-2.1.0-cp310-cp310-win_amd64.whl.metadata (59 kB)
Collecting openpyxl==3.1.5 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 21))Using cached openpyxl-3.1.5-py2.py3-none-any.whl.metadata (2.5 kB)
Collecting pandas==2.2.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 22))Using cached pandas-2.2.2-cp310-cp310-win_amd64.whl.metadata (19 kB)
Collecting pika==1.3.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 23))Using cached pika-1.3.2-py3-none-any.whl.metadata (13 kB)
Collecting prompt-toolkit==3.0.47 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 24))Using cached prompt_toolkit-3.0.47-py3-none-any.whl.metadata (6.4 kB)
Collecting psycopg2-binary==2.9.9 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 25))Using cached psycopg2_binary-2.9.9-cp310-cp310-win_amd64.whl.metadata (4.6 kB)
Collecting pymysql==1.1.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 26))Using cached PyMySQL-1.1.1-py3-none-any.whl.metadata (4.4 kB)
Collecting python-dateutil==2.9.0.post0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 27))Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz==2024.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 28))Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting redis==5.0.8 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 29))Using cached redis-5.0.8-py3-none-any.whl.metadata (9.2 kB)
Collecting requests==2.32.3 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 30))Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting six==1.16.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 31))Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting sqlparse==0.5.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 32))Using cached sqlparse-0.5.1-py3-none-any.whl.metadata (3.9 kB)
Collecting typing-extensions==4.12.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 33))Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting tzdata==2024.1 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 34))Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting tzlocal==5.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 35))Using cached tzlocal-5.2-py3-none-any.whl.metadata (7.8 kB)
Collecting urllib3==2.2.2 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 36))Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)
Collecting vine==5.1.0 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 37))Using cached vine-5.1.0-py3-none-any.whl.metadata (2.7 kB)
Collecting wcwidth==0.2.13 (from -r E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup\condaenv.gvwkf7xc.requirements.txt (line 38))Using cached wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB)
Using cached amqp-5.2.0-py3-none-any.whl (50 kB)
Using cached APScheduler-3.10.4-py3-none-any.whl (59 kB)
Using cached asgiref-3.8.1-py3-none-any.whl (23 kB)
Using cached async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Using cached billiard-4.2.0-py3-none-any.whl (86 kB)
Using cached celery-5.4.0-py3-none-any.whl (425 kB)
Using cached certifi-2024.8.30-py3-none-any.whl (167 kB)
Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (100 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached click_didyoumean-0.3.1-py3-none-any.whl (3.6 kB)
Using cached click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB)
Using cached click_repl-0.3.0-py3-none-any.whl (10 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached Django-5.1-py3-none-any.whl (8.2 MB)
Using cached django_apscheduler-0.6.2-py3-none-any.whl (24 kB)
Using cached et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)
Using cached idna-3.8-py3-none-any.whl (66 kB)
Using cached kombu-5.4.0-py3-none-any.whl (200 kB)
Using cached mysqlclient-2.2.4-cp310-cp310-win_amd64.whl (203 kB)
Using cached numpy-2.1.0-cp310-cp310-win_amd64.whl (12.9 MB)
Using cached openpyxl-3.1.5-py2.py3-none-any.whl (250 kB)
Using cached pandas-2.2.2-cp310-cp310-win_amd64.whl (11.6 MB)
Using cached pika-1.3.2-py3-none-any.whl (155 kB)
Using cached prompt_toolkit-3.0.47-py3-none-any.whl (386 kB)
Using cached psycopg2_binary-2.9.9-cp310-cp310-win_amd64.whl (1.2 MB)
Using cached PyMySQL-1.1.1-py3-none-any.whl (44 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached redis-5.0.8-py3-none-any.whl (255 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached sqlparse-0.5.1-py3-none-any.whl (44 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached tzlocal-5.2-py3-none-any.whl (17 kB)
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Using cached vine-5.1.0-py3-none-any.whl (9.6 kB)
Using cached wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Installing collected packages: wcwidth, pytz, vine, urllib3, tzdata, typing-extensions, sqlparse, six, pymysql, psycopg2-binary, prompt-toolkit, pika, numpy, mysqlclient, idna, et-xmlfile, colorama, charset-normalizer, certifi, billiard, async-timeout, tzlocal, requests, redis, python-dateutil, openpyxl, click, asgiref, amqp, pandas, kombu, django, click-repl, click-plugins, click-didyoumean, apscheduler, django-apscheduler, celery
Successfully installed amqp-5.2.0 apscheduler-3.10.4 asgiref-3.8.1 async-timeout-4.0.3 billiard-4.2.0 celery-5.4.0 certifi-2024.8.30 charset-normalizer-3.3.2 click-8.1.7 click-didyoumean-0.3.1 click-plugins-1.1.1 click-repl-0.3.0 colorama-0.4.6 django-5.1 django-apscheduler-0.6.2 et-xmlfile-1.1.0 idna-3.8 kombu-5.4.0 mysqlclient-2.2.4 numpy-2.1.0 openpyxl-3.1.5 pandas-2.2.2 pika-1.3.2 prompt-toolkit-3.0.47 psycopg2-binary-2.9.9 pymysql-1.1.1 python-dateutil-2.9.0.post0 pytz-2024.1 redis-5.0.8 requests-2.32.3 six-1.16.0 sqlparse-0.5.1 typing-extensions-4.12.2 tzdata-2024.1 tzlocal-5.2 urllib3-2.2.2 vine-5.1.0 wcwidth-0.2.13done
#
# To activate this environment, use
#
#     $ conda activate nudd-env-offical
#
# To deactivate an active environment, use
#
#     $ conda deactivatePS E:\RomulusHe\Projects\NUDD\DjangoProDemo-followup>

这篇关于手动安装environment.yml的依赖包的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1130909

相关文章

Zookeeper安装和配置说明

一、Zookeeper的搭建方式 Zookeeper安装方式有三种,单机模式和集群模式以及伪集群模式。 ■ 单机模式:Zookeeper只运行在一台服务器上,适合测试环境; ■ 伪集群模式:就是在一台物理机上运行多个Zookeeper 实例; ■ 集群模式:Zookeeper运行于一个集群上,适合生产环境,这个计算机集群被称为一个“集合体”(ensemble) Zookeeper通过复制来实现

CentOS7安装配置mysql5.7 tar免安装版

一、CentOS7.4系统自带mariadb # 查看系统自带的Mariadb[root@localhost~]# rpm -qa|grep mariadbmariadb-libs-5.5.44-2.el7.centos.x86_64# 卸载系统自带的Mariadb[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7

Centos7安装Mongodb4

1、下载源码包 curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.1.tgz 2、解压 放到 /usr/local/ 目录下 tar -zxvf mongodb-linux-x86_64-rhel70-4.2.1.tgzmv mongodb-linux-x86_64-rhel70-4.2.1/

每天认识几个maven依赖(ActiveMQ+activemq-jaxb+activesoap+activespace+adarwin)

八、ActiveMQ 1、是什么? ActiveMQ 是一个开源的消息中间件(Message Broker),由 Apache 软件基金会开发和维护。它实现了 Java 消息服务(Java Message Service, JMS)规范,并支持多种消息传递协议,包括 AMQP、MQTT 和 OpenWire 等。 2、有什么用? 可靠性:ActiveMQ 提供了消息持久性和事务支持,确保消

Centos7安装JDK1.8保姆版

工欲善其事,必先利其器。这句话同样适用于学习Java编程。在开始Java的学习旅程之前,我们必须首先配置好适合的开发环境。 通过事先准备好这些工具和配置,我们可以避免在学习过程中遇到因环境问题导致的代码异常或错误。一个稳定、高效的开发环境能够让我们更加专注于代码的学习和编写,提升学习效率,减少不必要的困扰和挫折感。因此,在学习Java之初,投入一些时间和精力来配置好开发环境是非常值得的。这将为我

安装nodejs环境

本文介绍了如何通过nvm(NodeVersionManager)安装和管理Node.js及npm的不同版本,包括下载安装脚本、检查版本并安装特定版本的方法。 1、安装nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash 2、查看nvm版本 nvm --version 3、安装

计算机毕业设计 大学志愿填报系统 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试

🍊作者:计算机编程-吉哥 🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。 🍊心愿:点赞 👍 收藏 ⭐评论 📝 🍅 文末获取源码联系 👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~Java毕业设计项目~热门选题推荐《1000套》 目录 1.技术选型 2.开发工具 3.功能

SWAP作物生长模型安装教程、数据制备、敏感性分析、气候变化影响、R模型敏感性分析与贝叶斯优化、Fortran源代码分析、气候数据降尺度与变化影响分析

查看原文>>>全流程SWAP农业模型数据制备、敏感性分析及气候变化影响实践技术应用 SWAP模型是由荷兰瓦赫宁根大学开发的先进农作物模型,它综合考虑了土壤-水分-大气以及植被间的相互作用;是一种描述作物生长过程的一种机理性作物生长模型。它不但运用Richard方程,使其能够精确的模拟土壤中水分的运动,而且耦合了WOFOST作物模型使作物的生长描述更为科学。 本文让更多的科研人员和农业工作者

K8S(Kubernetes)开源的容器编排平台安装步骤详解

K8S(Kubernetes)是一个开源的容器编排平台,用于自动化部署、扩展和管理容器化应用程序。以下是K8S容器编排平台的安装步骤、使用方式及特点的概述: 安装步骤: 安装Docker:K8S需要基于Docker来运行容器化应用程序。首先要在所有节点上安装Docker引擎。 安装Kubernetes Master:在集群中选择一台主机作为Master节点,安装K8S的控制平面组件,如AP

pip-tools:打造可重复、可控的 Python 开发环境,解决依赖关系,让代码更稳定

在 Python 开发中,管理依赖关系是一项繁琐且容易出错的任务。手动更新依赖版本、处理冲突、确保一致性等等,都可能让开发者感到头疼。而 pip-tools 为开发者提供了一套稳定可靠的解决方案。 什么是 pip-tools? pip-tools 是一组命令行工具,旨在简化 Python 依赖关系的管理,确保项目环境的稳定性和可重复性。它主要包含两个核心工具:pip-compile 和 pip