Well. 出色地。
Hello Mac people and Linux people, welcome to your setup video series. Mac 用户和 Linux 用户大家好，欢迎观看您的设置视频系列。
If you're a PC user, then what are you doing here? 如果您是 PC 用户，那么您在这里做什么？
We just set up your environment. 我们刚刚设置了您的环境。
You're set. 你已经准备好了。
Go on to the next lecture. 继续下一个讲座。
All right, Mac people, I had a rough time with the PC lot. 好吧，Mac 的朋友们，我在 PC 上度过了一段艰难的时光。
I am this is this is my sweet spot. 我就是这，这就是我的甜蜜点。
I'm a I'm a mac user, so this hopefully is going to be very easy and fun. 我是一名 Mac 用户，所以希望这会非常简单且有趣。
All right. 好的。
So I'm in a finder window here. 所以我现在在取景器窗口中。
And I've gone into utilities applications utilities to show you that that's where you can find terminal 我已经进入实用程序应用程序实用程序来向您展示您可以在其中找到终端
to open up a terminal if you're not familiar with that. 如果您不熟悉的话，请打开一个终端。
But I'm going to now assume that you know about this and open up a terminal. 但我现在假设您知道这一点并打开一个终端。
Here's one right here and make that a bit bigger for you. 这里有一个，你可以把它放大一点。
Hang on. 不挂断。
So this this is where we are going to do some of the next few steps. 这就是我们接下来要做的一些步骤的地方。
And we've actually got a five step process for setting up your environment. 实际上，我们有一个五步流程来设置您的环境。
And this is the first step which is about cloning the repo or getting a copy of the code for the class 这是第一步，涉及克隆存储库或获取该类的代码副本
onto your local box. 到您本地的盒子上。
Now I'm in my home directory here if I do PWD. 现在，如果我执行 PWD，我就位于我的主目录中。
If you're not familiar with the command prompt, I've included a guide to get you more comfortable more 如果您不熟悉命令提示符，我提供了一个指南，可以让您更加熟悉
confident using the command line. 自信地使用命令行。
It's common for people to have a directory called projects in their home directory where they put all 人们的主目录中通常有一个名为项目的目录，他们将所有内容都放在其中
of their their work projects. 他们的工作项目。
And if you have that, then if you do CD projects, it will go in there. 如果你有这个，那么如果你做 CD 项目，它就会放在那里。
Now it looks like I don't have one, so I have to make one with make directory projects and then change 现在看来我没有，所以我必须用 make Directory Projects 制作一个，然后更改
to projects. 到项目。
And now I'm in my empty projects directory, but you may have a few projects in there. 现在我在空的项目目录中，但那里可能有一些项目。
So the next step is now to bring the GitHub repo here. 因此，下一步是将 GitHub 存储库引入此处。
And so what we now do is we go using our favorite browser to a, a page where we have the repo which 所以我们现在要做的就是使用我们最喜欢的浏览器进入一个页面，在该页面上我们有存储库
is linked in the course materials. 链接在课程材料中。
This is what the repo looks like when you go to GitHub to my name and you see the repo here, here are 这是当你以我的名字访问 GitHub 并在此处看到该存储库时该存储库的样子，以下是
all of the directories, one for each of the weeks that we have coming up ahead of us, and then some 所有的目录，一个代表我们即将到来的每一周，然后是一些
general stuff. 一般的东西。
And if you scroll down you see something that's known as the project Readme. 如果向下滚动，您会看到名为项目自述文件的内容。
And it's really important because it's got great stuff in there. 这真的很重要，因为里面有很棒的东西。
And I urge you to read the readme and the things it links to. 我强烈建议您阅读自述文件及其链接的内容。
It begins with some stuff which includes another appeal to LinkedIn with me. 首先是一些内容，其中包括我对 LinkedIn 的另一个吸引力。
I seem to be quite desperate on this front. 我在这方面似乎很绝望。
And then comes the setup instructions. 然后是设置说明。
And there's a link for windows. 还有一个 Windows 的链接。
Instructions for the other guys. 给其他人的指示。
There's a link for Mac and Linux. 有适用于 Mac 和 Linux 的链接。
Come follow that link to get step by step instructions. 请点击该链接获取分步说明。
And to be honest, those instructions are going to be way clearer than than this video. 老实说，这些说明比这个视频要清楚得多。
And I'm going to keep them updated when people have problems. 当人们遇到问题时，我会及时向他们通报最新情况。
So that should really be your first place to go. 所以那确实应该是你要去的第一个地方。
And this video see it as like a video that goes along through it. 这段视频将其视为贯穿其中的视频。
So you get get a sense for it. 所以你会对它有一个感觉。
But the Readme also has lots of useful resources and a ton of important stuff on API costs that I urge 但自述文件中还包含大量有用的资源以及大量关于 API 成本的重要内容，我强烈建议您这样做
you to read, because I know this is a sensitive topic. 请您阅读，因为我知道这是一个敏感话题。
And so please do look through it and read all the other stuff and the links to the guides and so on. 因此，请务必仔细阅读它并阅读所有其他内容以及指南的链接等。
And I should probably mention that if you've not used GitHub before, you might need to create a new 我可能应该提到，如果您以前没有使用过 GitHub，您可能需要创建一个新的
account with GitHub to get to this point. 拥有 GitHub 帐户才能到达这一点。
Now, just before we clone this repo locally, I'd like to go back to the terminal window and I just 现在，就在我们在本地克隆此存储库之前，我想返回到终端窗口，然后我只是
want you to type git minus minus version to check that you've got git installed on your Mac, and it 希望你输入 git minus minus version 来检查你的 Mac 上是否安装了 git，并且它
should come up like mine does with a version number. 应该像我的那样出现版本号。
If it doesn't, you might need to run this command. 如果没有，您可能需要运行此命令。
Xcode select minus minus install, which installs some of the basic developer tools on your Mac. Xcode select minus minus install，这会在您的 Mac 上安装一些基本的开发人员工具。
I've got a link to that in the setup instructions. 我在设置说明中有一个链接。
I won't do it since I already have Xcode and Developer tools installed. 我不会这样做，因为我已经安装了 Xcode 和 Developer 工具。
Okay, so with that, if you're typing git minus minus version, you're getting a number there. 好的，如果你输入 git minus minus version，你会得到一个数字。
You come to the repo, you've signed in to GitHub, there's this green code button on the top right. 你来到仓库，你已经登录了 GitHub，右上角有一个绿色的代码按钮。
And you press there. 然后你按那里。
And probably I recommend that at this point you select the Https version. 也许我建议您此时选择 Https 版本。
I'm going to pick this version because I have that kind of credential. 我将选择这个版本，因为我有这样的凭证。
But but you can also pick the other one. 但你也可以选择另一个。
and then you copy that into your clipboard by pressing the copy button right there. 然后按那里的复制按钮将其复制到剪贴板中。
So once you've copied this text, which is the link to this, this repo, you then come back to the 因此，一旦您复制了此文本（即此存储库的链接），您就可以返回到
command line. 命令行。
And in your projects directory there I am I'm inside users ed projects. 在你的项目目录中，我在用户编辑的项目中。
I'm now going to type git clone, and then the repo link that I've pasted from my clipboard. 我现在要输入 git clone，然后输入我从剪贴板粘贴的存储库链接。
And I press enter and in it comes and it's done. 我按回车键，它就进来了，就完成了。
If I now have a look you'll see that there is a directory called agents. 如果我现在看一下，您会发现有一个名为“代理”的目录。
If I go into agents I now see that I have directories for the full project. 如果我进入代理，我现在会看到我有完整项目的目录。
And I want to mention that where we are right now in this directory that's in my projects directory, 我想提一下，我们现在在我的项目目录中的这个目录中，
the agents directory. 代理目录。
This here, this is known as the project root directory. 这里，这被称为项目根目录。
If you're inside the sort of top level directory of your project of agents. 如果您位于代理项目的顶级目录中。
So this is the project root. 所以这是项目根目录。
And you'll hear that referred to during the course and generally. 您会在课程中以及一般情况下听到提到这一点。
And so it's worth knowing that that's what it is. 因此，值得了解的是，事实就是如此。
But that is step one of the setup complete. 但这是设置完成的第一步。
Okay. 好的。
Welcome to step two of the setup for Mac. 欢迎来到 Mac 设置的第二步。
We're going to now install cursor the I IDE which is great. 我们现在要安装 Cursor I IDE，这很棒。
It is fabulous. 太棒了。
And you're going to love it. 你一定会喜欢它的。
If you've already got cursor then of course you can skip this step. 如果您已经有了光标，那么当然可以跳过这一步。
Otherwise bring up your favorite browser and go to cursor. 否则，打开您最喜欢的浏览器并转到光标。
And here we have the screen for installing cursor. 这里我们有安装光标的屏幕。
You will need to begin by creating an account using the sign up button over here. 您需要首先使用此处的注册按钮创建一个帐户。
If you don't have one already and it will just guide you through. 如果您还没有，它只会引导您完成。
I use my Google credentials myself, and I selected a Trial Pro plan myself, which is a free at least 我自己使用我的 Google 凭据，并且我自己选择了 Trial Pro 计划，该计划至少是免费的
for now. 目前。
And I then press download for Mac, which then brings down an installer. 然后我按下 Mac 版的“下载”，然后就会出现一个安装程序。
I then run that installer and it then asks me a couple of questions. 然后我运行该安装程序，然后它问我几个问题。
I log in and then it installs it. 我登录然后它就会安装它。
I mean, I'm sure you are used to these things. 我的意思是，我确信你已经习惯了这些事情。
You then drag and drop into applications and you open that up and it will install it. 然后，您将其拖放到应用程序中，然后打开它，它就会安装它。
Easy peasy. 简单易行。
I selected all of the default setup instructions, nothing special at all. 我选择了所有默认设置说明，没有什么特别的。
And then you should launch it and you should be in cursor. 然后你应该启动它并且你应该处于光标位置。
And that is where we will go next. 这就是我们下一步要去的地方。
Okay. 好的。
So once you've opened up cursor freshly installed this is what it should look like a nice big empty 因此，一旦您打开新安装的光标，它应该看起来像一个漂亮的大空的
screen. 屏幕。
And we're going to press the open project button right here. 我们将在此处按下“打开项目”按钮。
And we're going to then navigate to projects wherever that is. 然后我们将导航到项目，无论它在哪里。
I guess it's going to be at the top projects and then agents, which is the new folder that we've just 我想它将位于顶级项目，然后是代理，这是我们刚刚创建的新文件夹
installed. 安装。
This is known as the project root folder. 这称为项目根文件夹。
Here it is. 这里是。
And then we're going to press open. 然后我们要按下打开键。
And here it is. 就是这样。
Cursor opens up. 光标打开。
We've got a nice screen here that's known as the explorer which shows all of the files organized by 我们这里有一个很好的屏幕，称为资源管理器，它显示了按以下方式组织的所有文件
directories. 目录。
One of these directories might be open. 这些目录之一可能已打开。
You can just click the switch to collapse it like that. 您只需单击开关即可将其折叠起来。
There might be a box up here with some sort of welcome to cursor, blah blah blah. 这里可能会有一个框，上面有某种欢迎光标的信息，等等等等。
Just X out of that extra box on the top left if it's there for you. 如果左上角的那个额外的盒子里有适合你的东西，只需从其中取出 X 即可。
Over here is a chat screen where you can chat with an AI about your code. 这里是一个聊天屏幕，您可以在其中与人工智能讨论您的代码。
And I'm going to suggest for now we x out of that as well to keep things really clean. 我现在建议我们不要这样做，以保持事情真正干净。
So what we're looking at now is a nice big area here. 所以我们现在看到的是这里一个不错的大区域。
And the code the explorer to look at our directories right here, including the Readme and so on. 代码资源管理器就在这里查看我们的目录，包括自述文件等。
And congratulations you are into cursor. 恭喜您进入光标状态。
And that is the second step of the instructions completed. 这就是完成说明的第二步。
And we are now onto step three of the instructions which are my very favorite step where you're going 现在我们进入了说明的第三步，这是我最喜欢的一步
to install. 安装。
You've the package manager which is so fabulous, so quick and easy to use, and you're going to be 您拥有非常棒、快速且易于使用的包管理器，您将会
really happy about this. 对此真的很高兴。
I know it's like another new thing to learn, which is always a pain, but I tell you, it's so great. 我知道这就像要学习另一项新事物，这总是一种痛苦，但我告诉你，它太棒了。
The reason we're doing this is partly because a student on my prior course, said, you know, you really 我们这样做的部分原因是因为我之前课程的一名学生说，你知道，你真的
should use UV. 应使用紫外线。
It's so much better. 好多了。
And so I'd heard of it. 所以我听说过它。
I knew it was doing the rounds, but I hadn't actually used it myself until that, and that pushed me 我知道它正在流行，但在那之前我自己并没有真正使用过它，这推动了我
to do it. 去做它。
And I've never looked back. 我从未回头。
And we'll find that many of the AI platforms, the agent platforms will use or use UV themselves. 我们会发现很多AI平台、代理平台都会使用或者自己使用UV。
So it's going to work out really well for us. 所以这对我们来说会非常顺利。
You're going to be grateful I showed you this if you're not already a UV convert. 如果您还不是紫外线转换者，您会很感激我向您展示了这一点。
All right. 好的。
So first step is to install UV. 所以第一步是安装UV。
And the way you do that is you bring up a browser window. 这样做的方法是打开一个浏览器窗口。
And yeah you can just Google for UV package manager. 是的，你可以通过 Google 搜索 UV 包管理器。
Or you can look at the link that I'll have in the instructions, and you'll see that there is the um 或者您可以查看我在说明中提供的链接，您会看到有 um
link to the GitHub. 链接到 GitHub。
And it has within it some clear installation instructions. 其中有一些明确的安装说明。
You just simply have to run this one command in a terminal, and I will copy that to the clipboard. 您只需在终端中运行这个命令，我会将其复制到剪贴板。
There it is. 就在那里。
Now there's actually a new easy way to run things in a terminal because you can do it within cursor. 现在实际上有一种新的简单方法可以在终端中运行，因为您可以在光标内执行此操作。
Here's my cursor screen again. 这又是我的光标屏幕。
And there's actually a view menu. 实际上有一个视图菜单。
And you can go view and then terminal. 你可以去查看然后终端。
Or you can know to press the control button not the command button, not the one with the squiggle clover 或者你可以知道按控制按钮而不是命令按钮，而不是带有波浪线三叶草的按钮
on it, but the control button on the bottom left of your keyboard control. 就在上面，而是键盘控制左下角的控制按钮。
And then the tick mark on the top left of your keyboard. 然后是键盘左上角的勾号。
Or at least on my keyboard. 或者至少在我的键盘上。
And up comes a terminal. 然后出现了一个终端。
But you could also go to the view menu and choose terminal. 但您也可以转到查看菜单并选择终端。
And here it is. 就是这样。
And now you can simply paste in that command to run the installation for you've. 现在您只需粘贴该命令即可运行安装。
And it will be super quick and you'll be done. 它会非常快，你就会完成。
I'm not going to run it because I've already run it. 我不会运行它，因为我已经运行了它。
Once you've done that, you might need to close this terminal by pressing the the X, and you might 完成此操作后，您可能需要按 X 关闭此终端，并且您可能
actually need to to quit out of right right out of cursor and bring back up cursor because it needs 实际上需要退出光标并恢复光标，因为它需要
to refresh its environment variables. 刷新其环境变量。
But but if you've done that then if you type UV minus minus version, it should give you a version number 但是，如果你已经这样做了，那么如果你输入 UV minus minus version，它应该给你一个版本号
which is telling you that all is good, UV is installed. 这告诉您一切都很好，UV 已安装。
And uh, with that we are almost ready to go. 呃，这样我们就差不多准备好了。
There is now only one command left. 现在只剩下一个命令了。
And what is that command? 那是什么命令？
I hear you ask. 我听到你问。
It is simply to type at this point. 此时只需键入即可。
You see like that. 你看就是这样。
And what that's going to do is it's going to look at some of the other files here, like a Python version 它将查看这里的一些其他文件，例如 Python 版本
file and a pyproject.toml and some other things and a UV lock. 文件和 pyproject.toml 以及其他一些东西和 UV 锁。
And it's going to use that to build our environment and let's see it doing that. 它将使用它来构建我们的环境，让我们看看它是如何做到的。
Off it goes. 关了就走了。
Now I told you that it's quick and you'll see that it was very quick. 现在我告诉你它很快，你会发现它非常快。
That is just done. 那是刚刚完成的。
But that's actually quicker than it will be for you. 但这实际上比您要快。
And it's that quick because it does cache things that I've done before. 它之所以那么快，是因为它确实缓存了我之前做过的事情。
When you do this, it's going to take about three minutes, four minutes, which is still very quick 当你这样做的时候，大约需要三分钟、四分钟，还是很快的
because Anaconda takes like an hour or something. 因为 Anaconda 大约需要一个小时左右。
So it's going to be fast, but there is still a lot to be installed, so you'll have to sit back and 所以它会很快，但仍然有很多东西需要安装，所以你必须坐下来
wait while everything installs, but enjoy the raw power of UV as everything gets built there And once 等待一切安装完毕，但当所有东西都在那里建造时，请享受紫外线的原始力量一次
it's done, what you may notice is that there's a new. 完成了，您可能会注意到有一个新的。
Directory called dot that's appeared, which is like a traditional Python virtual environment. 出现了一个叫做dot的目录，它就像一个传统的Python虚拟环境。
If you know these things that it's created one for this project. 如果你知道这些事情，它就会为这个项目创建一个。
And so one of the really nice things about UV is that it's compatible and consistent with all of the 因此，UV 的真正好处之一是它与所有的兼容和一致
other ways you do things in Python. 在 Python 中执行操作的其他方式。
It's not like there's a new sort of thing like Conda. 并不是有像 Conda 这样的新东西。
So it's that's been set up and now that is going to be the environment that we'll be using from this 所以它已经设置好了，现在这将是我们将要使用的环境
point onwards. 点向前。
And when you run a Python script, whereas before you might have typed Python and then something, what 当你运行 Python 脚本时，而之前你可能已经输入了 Python，然后输入了一些东西，什么
you're going to type now is you've run and then that same thing and that automatically makes sure that 你现在要输入的是你已经运行了，然后是同样的事情，这会自动确保
it runs in that environment. 它在该环境中运行。
The other thing to mention is that it has installed a dedicated version of Python, right? 另外值得一提的是，它已经安装了专用版本的Python，对吧？
For this project. 对于这个项目。
It is in fact a Python version 3.1. 它实际上是 Python 3.1 版本。
Uh, whilst the latest version of Python is 3.13. 呃，Python 的最新版本是 3.13。
That's not yet not. 那还不是。
Not all data science packages are ready for that yet. 并非所有数据科学包都已为此做好准备。
So 3.1 is what we're using and everything will be in that Python. 所以我们正在使用 3.1，所有内容都将在该 Python 中。
It will have installed it for you if you didn't already have it, and it will be dedicated for this 如果您还没有安装它，它会专门为您安装
project. 项目。
UV is really good. 紫外线真的很好。
It combines this kind of isolated environment with something that is fast and simple, and I very much 它将这种孤立的环境与快速简单的东西结合起来，我非常喜欢
hope that this will have simply worked for you. 希望这对你有用。
And that means that step three is done and we can move on to step four. 这意味着第三步已经完成，我们可以继续第四步。
So for step four, we're going to set up a key with OpenAI. 因此，对于第四步，我们将使用 OpenAI 设置密钥。
Now again I want to emphasize that whilst I do encourage you to be setting up a key with OpenAI and 现在我想再次强调，虽然我确实鼓励您使用 OpenAI 设置密钥，
to be using that API, it is not required for this project for this course. 要使用该 API，本课程的项目不需要使用该 API。
And there are alternatives in the Readme, but that's what we're going to do now. 自述文件中有其他选择，但这就是我们现在要做的。
I'm going to assume that you are good for this and that we can come in. 我假设你很擅长这个，我们可以加入。
And so you go to platform dot Openai.com just here like that. 因此，您可以像这样访问 Openai.com 平台。
And this brings you to the front screen of OpenAI where you get to set up an account. 这会将您带到 OpenAI 的前屏幕，您可以在其中设置帐户。
If you don't have one already, sign up or log in if you have one. 如果您还没有，请注册或登录（如果您有）。
And I'm going to log in because I already have one. 我要登录，因为我已经有了一个。
Log in with my Google credentials. 使用我的 Google 凭据登录。
And here we have my account. 这里有我的帐户。
We're logged in and you will hopefully have done the same. 我们已登录，希望您也已登录。
Let me make this nice and big for you. 让我为你把这个变得又漂亮又大。
Okay. 好的。
So there are now two things that we have to do now that we're in OpenAI. 因此，现在我们在 OpenAI 中必须做两件事。
And we're going to go and do both of them now bearing in mind this is not required, you can also do 我们现在要去做这两件事，记住这不是必需的，你也可以这样做
the same thing, this analogous website for deep seek and for many others, you could be setting up 同样的事情，这个类似的网站用于深度搜索和许多其他网站，您可以建立
your keys in any of them and just follow the same kind of process. 将您的密钥放入其中任何一个中，然后遵循相同的过程即可。
But let's get to that now. 但现在让我们开始吧。
So as I say, it's two steps. 正如我所说，这是两个步骤。
The first of them is to go to the settings menu up here and come down to billing. 第一个是进入此处的设置菜单并进行计费。
And this is where you set up your billing details. 您可以在此处设置帐单详细信息。
Now you have to apply a credit balance giving OpenAI some money in advance. 现在你必须申请信用余额，提前给 OpenAI 一些钱。
And I've given it quite a lot of money right here because I'm doing various different things and you 我在这里给了它很多钱，因为我正在做各种不同的事情，而你
do not need to give it that much money by any means. 无论如何都不需要给它那么多钱。
There is a minimum top up. 有最低充值限额。
They require at least $5 as of right now, but they are. 截至目前，他们至少需要 5 美元，但事实确实如此。
They sometimes have deals. 他们有时会有优惠。
There's something going on down here that you could read about. 这里正在发生一些事情，您可以阅读一下。
Perhaps there's some some deal for free tokens right now, but there's different deals and you can press 也许现在有一些免费代币的交易，但有不同的交易，您可以按
the Add to credit balance to put in your $5 up front. 添加到信用余额以预先存入 5 美元。
That's that's, I believe, required right now. 我相信，这就是现在所需要的。
And we'll only spend a few dollars of that on this course, and that you have complete flexibility and 我们只会在这门课程上花费几美元，并且您拥有完全的灵活性和
you can come back and watch to what extent you're spending your credits as we go through. 您可以回来看看您在我们讨论的过程中花费了多少积分。
But but I suggest doing that, putting in your $5. 但我建议这样做，投入 5 美元。
But bear in mind, if you don't want to, you don't need to. 但请记住，如果您不想，则不需要。
Once you've done that, you then turn to the API keys. 完成此操作后，您将转向 API 密钥。
Part of this, which is where you get to see the key that you've set up that you will use for this project. 其中一部分是您可以看到您设置的将用于该项目的密钥的地方。
And if you already have a key, then then great, you're in good shape, but I assume you don't, in 如果你已经有钥匙了，那就太好了，你的状态很好，但我认为你没有，在
which case you press this green. 在这种情况下你按这个绿色。
Create new secret key. 创建新的密钥。
You leave, you give it a name that just doesn't matter. 你离开，你给它起一个无关紧要的名字。
Just for your future reference. 仅供您以后参考。
And then for projects, be sure to choose default Project and leave it as all permissions and then press 然后对于项目，请务必选择默认项目并将其保留为所有权限，然后按
Create Secret Key. 创建密钥。
It's then going to prompt you. 然后它会提示你。
It's going to bring up your key that you'll use. 它将显示您将使用的密钥。
And you can copy it into your clipboard. 您可以将其复制到剪贴板中。
And we're going to paste it in a moment into cursor in a place where we were going to use it. 我们稍后将把它粘贴到光标中我们要使用它的地方。
Now here's the thing. 现在事情是这样的。
Here is a nasty gotcha to be aware of. 这里有一个需要注意的棘手问题。
It's very tempting to take your key and paste it into a useful app, like, like the notepad or something, 很容易将您的密钥粘贴到有用的应用程序中，例如记事本或其他应用程序，
but there's a trap there you need to be careful of. 但那里有一个陷阱你需要小心。
Some programs, I think, including notepad. 我认为有些程序包括记事本。
If you paste in some text and then press enter, it changes some of the characters in that text to be 如果您粘贴某些文本然后按 Enter 键，则会将该文本中的某些字符更改为
nicer, formatted like it turns hyphens into long hyphens, and that can be really hard to spot. 更好，格式就像将连字符变成长连字符，这真的很难发现。
And that will then basically invalidate your key. 这基本上会使你的密钥失效。
Your key will now be a different set of letters or characters, and when you try and use that in your 您的密钥现在将是一组不同的字母或字符，当您尝试在您的应用程序中使用它时
file, it's going to fail and it's going to be almost impossible to track it down because it's going 文件，它将会失败并且几乎不可能追踪它，因为它正在
to look perfect. 看起来很完美。
And it's really frustrating. 这真的很令人沮丧。
And a lot of people have had that problem. 很多人都遇到过这个问题。
So I urge you just to copy it into the clipboard and paste it straight into cursor in the next step. 因此，我建议您将其复制到剪贴板中，然后在下一步中将其直接粘贴到光标中。
And it is good to to keep a copy of it somewhere. 最好将其副本保存在某个地方。
Just be really careful to make sure you do it in a way that doesn't overwrite your characters, so that 只是要非常小心，确保你这样做的方式不会覆盖你的角色，这样
you're keeping the original and and it feels in good shape. 你保留了原件，而且感觉状态良好。
So there is my, uh, public service announcement about about things to watch out for with keys. 我的，呃，公共服务公告是关于使用钥匙时需要注意的事项。
But hopefully you've set up your key, you've copied it to the clipboard, you've maybe made a backup 但希望你已经设置了你的密钥，你已经将它复制到剪贴板，你可能已经做了备份
somewhere safe. 安全的地方。
And now we're ready for the next part. 现在我们已经准备好进行下一部分了。
And this is step five of the environment set up. 这是环境设置的第五步。
And it's the last step. 这是最后一步。
We're almost completely done. 我们几乎完全完成了。
We're back in cursor again looking at cursor. 我们再次回到光标处查看光标。
And I'm just going to I'm going to press an X here to get rid of that screen. 我只是要按一下 X 来删除该屏幕。
I'm going to press an X to get rid of my terminal. 我要按 X 来删除我的终端。
So we're looking at a nice clean page here. 所以我们在这里看到一个漂亮的干净页面。
now. 现在。
Down here in the explorer. 在探险家的下面。
I've collapsed all these folders. 我已经折叠了所有这些文件夹。
I'm going to right click and say new file at the bottom here. 我将右键单击并在此处底部说出新文件。
And I'm going to create a new file. 我将创建一个新文件。
And I'm going to give it a very precise name. 我将给它一个非常精确的名称。
And you have to give it exactly the same name. 并且您必须为其指定完全相同的名称。
If you get this wrong by a single character, then you're going to have problems later. 如果你在一个字符上犯了错误，那么你以后就会遇到问题。
So so be careful with this one. 所以这一点一定要小心。
It starts with a dot, the period, a full stop, and then the letters E, dot, E, env. 它以点、句号、句号开头，然后是字母 E、点、E、env。
And it's got to be called exactly that. 它必须被准确地称为这个。
And you'll see why later. 稍后您就会明白原因。
But basically this this is a file which is often used to store environment variables, things that will 但基本上这是一个经常用来存储环境变量的文件，
load into our environment as variables that we'll use for things like passwords and tokens and keys. 作为变量加载到我们的环境中，我们将使用这些变量来存储密码、令牌和密钥等内容。
And it doesn't get checked into GitHub. 而且它不会被签入 GitHub。
So it stays as a private file just for you. 因此，它会保留为您的私人文件。
And it's a common technique for managing these kinds of things. 这是管理此类事情的常用技术。
And it's called dot env. 它被称为 dot env。
And it has to be called exactly that. 它必须被准确地称为。
So what we can now do is type into here a key that we want to to remember. 所以我们现在可以做的就是在这里输入我们想要记住的密钥。
And in particular the one that we want to remember is OpenAI's key. 我们特别要记住的是 OpenAI 的密钥。
And it's it's OpenAI underscore API underscore key. 它是 OpenAI 下划线 API 下划线键。
And it's actually prompting me right here for it because cursor is that clever and knows what we're 它实际上在这里提示我，因为光标很聪明并且知道我们在做什么
trying to do. 试图做。
And we can just press Tab to fill it all the way in. 我们只需按 Tab 键即可将其全部填充。
But I'm not going to do that. 但我不会那样做。
I am going to type OpenAI API key equals no quote marks, no spaces, no spaces before or after and 我要输入 OpenAI API key 等于没有引号、没有空格、前后没有空格以及
people. 人们。
One common mistake is that sometimes people say open API key or OpenAI key, but it's not that it's 一个常见的错误是，有时人们说开放 API 密钥或 OpenAI 密钥，但事实并非如此。
OpenAI API key. OpenAI API 密钥。
And it's got to be exactly this. 一定是这样的。
I think this is one of the only things in this course where every letter needs to be right. 我认为这是本课程中唯一要求每个字母都正确的事情之一。
And so be careful. 所以要小心。
This is like 90% of the reason that people are frustrated in environment setup. 这就像人们在环境设置中感到沮丧的 90% 原因。
Is this this very file. 这就是这个文件吗？
All right. 好的。
What comes next is you simply paste in here exactly the key that came from OpenAI. 接下来，您只需将来自 OpenAI 的密钥粘贴到此处即可。
And it should begin ESC dash proj dash, and then a bunch of letters and numbers with maybe an underscore 它应该以 ESC dash proj dash 开头，然后是一堆字母和数字，可能带有下划线
symbol as well. 符号也是如此。
And that should all come there. 这一切都应该发生。
A bunch of them, not 123456780 as it has here in cursor, but a real key and not SK proj, and then 其中一堆，不是光标中的 123456780，而是真正的密钥，而不是 SK proj，然后
another SK proj or anything like that that some people have done. 另一个 SK 项目或者一些人做过的类似的事情。
It's got to be just right. 一定要恰到好处。
Sorry to go on about it, but this is such a cause of problems. 很抱歉继续说下去，但这就是问题的根源。
So so make sure that that key, the thing that's showing in purple here, is exactly the key that you 因此，请确保该键（此处显示为紫色的东西）正是您要使用的键。
took from open AI. 取自开放人工智能。
And it should look perfect. 它看起来应该很完美。
And once you've done that you do command S to save this file. 完成后，您可以使用命令 S 来保存该文件。
And you'll be in great shape. 而且你会保持良好的状态。
And at that point that will then be the end of step five of the environment setup. 到那时，环境设置的第五步就结束了。
We will have done environment setup and we're good to get into the to the actual project. 我们将完成环境设置，并且很高兴进入实际项目。
How about that. 怎么样？
So congratulations. 所以恭喜你。
Thank you. 谢谢。
Hopefully this is now all going to work. 希望这一切现在都能发挥作用。
We'll soon find out. 我们很快就会知道。
I will see you in the next lecture when we reconvene with team PC. 当我们与 PC 团队重聚时，我们将在下一次讲座中与您见面。