【python】【conda】【创建项目 】

本教程介绍了如何在conda环境中创建和管理Python项目。通过编写一个`environment.yml`文件,跟踪项目依赖,创建环境,编写简单的Python应用,并演示如何随着项目发展添加新依赖。教程涵盖了从创建项目文件、创建环境到执行数据分析的整个过程。
摘要由CSDN通过智能技术生成

目录

Creating projects

创建项目

1 Requirements 

1 需求

2 Creating the project's files

2 创建项目文件

3 Creating our environment

3 创造环境

4 Creating our Python application

4 创建Python应用程序

5 Updating our project with new dependencies

5 使用新的依赖项更新我们的项目

6 Conclusion

6 结论

Creating projects

创建项目

In this tutorial, we will walk through how to set up a new Python project in conda using an environment.yml file.

This file will help you keep track of your dependencies and share your project with others. We cover how to create your project, add a simple Python program and update it with new dependencies.
在本教程中,我们将介绍如何使用
 environment.yml 文件在conda中设置一个新的Python项目。此文件将帮助您跟踪依赖项并与其他人共享您的项目。

我们将介绍如何创建您的项目,添加一个简单的Python程序并使用新的依赖项更新它。

1 Requirements 

1 需求

To follow along, you will need a working conda installation. Please head over to our installation guide for instructions on how to get conda installed if you do not have it.
要遵循沿着,您将需要一个工作conda安装。如果您没有安装conda,请查看我们的安装指南,了解如何安装conda。

This tutorial relies heavily on using your computer's terminal (Command Prompt or PowerShell on Windows), so it is also important to have a working familiarity with using basic commands such as cd and ls.
本教程在很大程度上依赖于使用计算机的终端(Windows上的命令提示符或PowerShell),因此熟悉使用基本命令(如 cd 和 ls )也很重要。

2 Creating the project's files

2 创建项目文件

To start off, we will need a directory that will contain the files for our project. This can be created with the following command:
首先,我们需要一个包含项目文件的目录。这可以通过以下命令创建:

mkdir my-project

In this directory, we will now create a new environment.yaml file, which will hold the dependencies for our Python project. In your text editor (e.g. VSCode, PyCharm, vim, etc.), create this file and add the following:
在这个目录中,我们现在将创建一个新的 environment.yaml 文件,它将保存Python项目的依赖项。在你的文本编辑器中(例如VSCode,PyCharm,Vim等),创建此文件并添加以下内容:

name: my-project
channels:
  - defaults
dependencies:
  - python
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

资源存储库

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值