1
00:00:00,280 --> 00:00:00,640
Well.
出色地。

2
00:00:00,640 --> 00:00:05,440
Hello Mac people and Linux people, welcome to your setup video series.
Mac 用户和 Linux 用户大家好，欢迎观看您的设置视频系列。

3
00:00:05,440 --> 00:00:07,720
If you're a PC user, then what are you doing here?
如果您是 PC 用户，那么您在这里做什么？

4
00:00:07,720 --> 00:00:09,000
We just set up your environment.
我们刚刚设置了您的环境。

5
00:00:09,000 --> 00:00:09,680
You're set.
你已经准备好了。

6
00:00:09,720 --> 00:00:11,160
Go on to the next lecture.
继续下一个讲座。

7
00:00:11,480 --> 00:00:14,280
All right, Mac people, I had a rough time with the PC lot.
好吧，Mac 的朋友们，我在 PC 上度过了一段艰难的时光。

8
00:00:14,320 --> 00:00:16,760
I am this is this is my sweet spot.
我就是这，这就是我的甜蜜点。

9
00:00:16,800 --> 00:00:21,720
I'm a I'm a mac user, so this hopefully is going to be very easy and fun.
我是一名 Mac 用户，所以希望这会非常简单且有趣。

10
00:00:22,040 --> 00:00:22,640
All right.
好的。

11
00:00:22,640 --> 00:00:24,800
So I'm in a finder window here.
所以我现在在取景器窗口中。

12
00:00:24,800 --> 00:00:29,880
And I've gone into utilities applications utilities to show you that that's where you can find terminal
我已经进入实用程序应用程序实用程序来向您展示您可以在其中找到终端

13
00:00:29,920 --> 00:00:32,800
to open up a terminal if you're not familiar with that.
如果您不熟悉的话，请打开一个终端。

14
00:00:32,800 --> 00:00:36,760
But I'm going to now assume that you know about this and open up a terminal.
但我现在假设您知道这一点并打开一个终端。

15
00:00:36,840 --> 00:00:39,640
Here's one right here and make that a bit bigger for you.
这里有一个，你可以把它放大一点。

16
00:00:39,760 --> 00:00:40,480
Hang on.
不挂断。

17
00:00:40,600 --> 00:00:45,960
So this this is where we are going to do some of the next few steps.
这就是我们接下来要做的一些步骤的地方。

18
00:00:46,240 --> 00:00:50,080
And we've actually got a five step process for setting up your environment.
实际上，我们有一个五步流程来设置您的环境。

19
00:00:50,080 --> 00:00:56,600
And this is the first step which is about cloning the repo or getting a copy of the code for the class
这是第一步，涉及克隆存储库或获取该类的代码副本

20
00:00:56,600 --> 00:00:58,000
onto your local box.
到您本地的盒子上。

21
00:00:58,160 --> 00:01:01,610
Now I'm in my home directory here if I do PWD.
现在，如果我执行 PWD，我就位于我的主目录中。

22
00:01:01,650 --> 00:01:06,330
If you're not familiar with the command prompt, I've included a guide to get you more comfortable more
如果您不熟悉命令提示符，我提供了一个指南，可以让您更加熟悉

23
00:01:06,330 --> 00:01:08,490
confident using the command line.
自信地使用命令行。

24
00:01:08,850 --> 00:01:13,730
It's common for people to have a directory called projects in their home directory where they put all
人们的主目录中通常有一个名为项目的目录，他们将所有内容都放在其中

25
00:01:13,730 --> 00:01:15,690
of their their work projects.
他们的工作项目。

26
00:01:15,690 --> 00:01:19,210
And if you have that, then if you do CD projects, it will go in there.
如果你有这个，那么如果你做 CD 项目，它就会放在那里。

27
00:01:19,250 --> 00:01:25,930
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 制作一个，然后更改

28
00:01:25,930 --> 00:01:26,970
to projects.
到项目。

29
00:01:26,970 --> 00:01:31,850
And now I'm in my empty projects directory, but you may have a few projects in there.
现在我在空的项目目录中，但那里可能有一些项目。

30
00:01:32,050 --> 00:01:36,530
So the next step is now to bring the GitHub repo here.
因此，下一步是将 GitHub 存储库引入此处。

31
00:01:37,130 --> 00:01:45,450
And so what we now do is we go using our favorite browser to a, a page where we have the repo which
所以我们现在要做的就是使用我们最喜欢的浏览器进入一个页面，在该页面上我们有存储库

32
00:01:45,450 --> 00:01:47,210
is linked in the course materials.
链接在课程材料中。

33
00:01:47,210 --> 00:01:52,650
This is what the repo looks like when you go to GitHub to my name and you see the repo here, here are
这是当你以我的名字访问 GitHub 并在此处看到该存储库时该存储库的样子，以下是

34
00:01:52,650 --> 00:01:57,570
all of the directories, one for each of the weeks that we have coming up ahead of us, and then some
所有的目录，一个代表我们即将到来的每一周，然后是一些

35
00:01:57,570 --> 00:01:58,130
general stuff.
一般的东西。

36
00:01:58,130 --> 00:02:01,940
And if you scroll down you see something that's known as the project Readme.
如果向下滚动，您会看到名为项目自述文件的内容。

37
00:02:01,940 --> 00:02:04,340
And it's really important because it's got great stuff in there.
这真的很重要，因为里面有很棒的东西。

38
00:02:04,340 --> 00:02:07,580
And I urge you to read the readme and the things it links to.
我强烈建议您阅读自述文件及其链接的内容。

39
00:02:07,620 --> 00:02:11,900
It begins with some stuff which includes another appeal to LinkedIn with me.
首先是一些内容，其中包括我对 LinkedIn 的另一个吸引力。

40
00:02:11,940 --> 00:02:14,100
I seem to be quite desperate on this front.
我在这方面似乎很绝望。

41
00:02:14,300 --> 00:02:17,380
And then comes the setup instructions.
然后是设置说明。

42
00:02:17,380 --> 00:02:18,700
And there's a link for windows.
还有一个 Windows 的链接。

43
00:02:18,700 --> 00:02:20,300
Instructions for the other guys.
给其他人的指示。

44
00:02:20,300 --> 00:02:22,540
There's a link for Mac and Linux.
有适用于 Mac 和 Linux 的链接。

45
00:02:22,780 --> 00:02:25,860
Come follow that link to get step by step instructions.
请点击该链接获取分步说明。

46
00:02:25,860 --> 00:02:30,300
And to be honest, those instructions are going to be way clearer than than this video.
老实说，这些说明比这个视频要清楚得多。

47
00:02:30,300 --> 00:02:32,740
And I'm going to keep them updated when people have problems.
当人们遇到问题时，我会及时向他们通报最新情况。

48
00:02:32,740 --> 00:02:35,500
So that should really be your first place to go.
所以那确实应该是你要去的第一个地方。

49
00:02:35,540 --> 00:02:38,260
And this video see it as like a video that goes along through it.
这段视频将其视为贯穿其中的视频。

50
00:02:38,260 --> 00:02:40,060
So you get get a sense for it.
所以你会对它有一个感觉。

51
00:02:40,500 --> 00:02:45,820
But the Readme also has lots of useful resources and a ton of important stuff on API costs that I urge
但自述文件中还包含大量有用的资源以及大量关于 API 成本的重要内容，我强烈建议您这样做

52
00:02:45,820 --> 00:02:47,820
you to read, because I know this is a sensitive topic.
请您阅读，因为我知道这是一个敏感话题。

53
00:02:47,860 --> 00:02:54,100
And so please do look through it and read all the other stuff and the links to the guides and so on.
因此，请务必仔细阅读它并阅读所有其他内容以及指南的链接等。

54
00:02:54,940 --> 00:02:58,780
And I should probably mention that if you've not used GitHub before, you might need to create a new
我可能应该提到，如果您以前没有使用过 GitHub，您可能需要创建一个新的

55
00:02:58,870 --> 00:03:01,230
account with GitHub to get to this point.
拥有 GitHub 帐户才能到达这一点。

56
00:03:01,670 --> 00:03:07,590
Now, just before we clone this repo locally, I'd like to go back to the terminal window and I just
现在，就在我们在本地克隆此存储库之前，我想返回到终端窗口，然后我只是

57
00:03:07,590 --> 00:03:14,350
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，并且它

58
00:03:14,350 --> 00:03:17,470
should come up like mine does with a version number.
应该像我的那样出现版本号。

59
00:03:17,750 --> 00:03:20,430
If it doesn't, you might need to run this command.
如果没有，您可能需要运行此命令。

60
00:03:20,470 --> 00:03:27,630
Xcode select minus minus install, which installs some of the basic developer tools on your Mac.
Xcode select minus minus install，这会在您的 Mac 上安装一些基本的开发人员工具。

61
00:03:27,670 --> 00:03:30,150
I've got a link to that in the setup instructions.
我在设置说明中有一个链接。

62
00:03:30,150 --> 00:03:34,710
I won't do it since I already have Xcode and Developer tools installed.
我不会这样做，因为我已经安装了 Xcode 和 Developer 工具。

63
00:03:34,750 --> 00:03:39,590
Okay, so with that, if you're typing git minus minus version, you're getting a number there.
好的，如果你输入 git minus minus version，你会得到一个数字。

64
00:03:39,590 --> 00:03:46,310
You come to the repo, you've signed in to GitHub, there's this green code button on the top right.
你来到仓库，你已经登录了 GitHub，右上角有一个绿色的代码按钮。

65
00:03:46,510 --> 00:03:47,990
And you press there.
然后你按那里。

66
00:03:48,110 --> 00:03:52,950
And probably I recommend that at this point you select the Https version.
也许我建议您此时选择 Https 版本。

67
00:03:53,070 --> 00:03:56,470
I'm going to pick this version because I have that kind of credential.
我将选择这个版本，因为我有这样的凭证。

68
00:03:56,470 --> 00:03:58,470
But but you can also pick the other one.
但你也可以选择另一个。

69
00:03:58,560 --> 00:04:04,040
and then you copy that into your clipboard by pressing the copy button right there.
然后按那里的复制按钮将其复制到剪贴板中。

70
00:04:04,400 --> 00:04:10,520
So once you've copied this text, which is the link to this, this repo, you then come back to the
因此，一旦您复制了此文本（即此存储库的链接），您就可以返回到

71
00:04:10,520 --> 00:04:11,240
command line.
命令行。

72
00:04:11,240 --> 00:04:16,360
And in your projects directory there I am I'm inside users ed projects.
在你的项目目录中，我在用户编辑的项目中。

73
00:04:16,360 --> 00:04:23,720
I'm now going to type git clone, and then the repo link that I've pasted from my clipboard.
我现在要输入 git clone，然后输入我从剪贴板粘贴的存储库链接。

74
00:04:23,920 --> 00:04:27,640
And I press enter and in it comes and it's done.
我按回车键，它就进来了，就完成了。

75
00:04:27,840 --> 00:04:31,640
If I now have a look you'll see that there is a directory called agents.
如果我现在看一下，您会发现有一个名为“代理”的目录。

76
00:04:31,760 --> 00:04:38,400
If I go into agents I now see that I have directories for the full project.
如果我进入代理，我现在会看到我有完整项目的目录。

77
00:04:38,840 --> 00:04:44,280
And I want to mention that where we are right now in this directory that's in my projects directory,
我想提一下，我们现在在我的项目目录中的这个目录中，

78
00:04:44,280 --> 00:04:45,840
the agents directory.
代理目录。

79
00:04:46,000 --> 00:04:50,120
This here, this is known as the project root directory.
这里，这被称为项目根目录。

80
00:04:50,120 --> 00:04:54,720
If you're inside the sort of top level directory of your project of agents.
如果您位于代理项目的顶级目录中。

81
00:04:54,880 --> 00:04:56,200
So this is the project root.
所以这是项目根目录。

82
00:04:56,200 --> 00:04:58,970
And you'll hear that referred to during the course and generally.
您会在课程中以及一般情况下听到提到这一点。

83
00:04:58,970 --> 00:05:00,810
And so it's worth knowing that that's what it is.
因此，值得了解的是，事实就是如此。

84
00:05:00,810 --> 00:05:04,250
But that is step one of the setup complete.
但这是设置完成的第一步。

85
00:05:04,890 --> 00:05:05,290
Okay.
好的。

86
00:05:05,290 --> 00:05:07,530
Welcome to step two of the setup for Mac.
欢迎来到 Mac 设置的第二步。

87
00:05:07,530 --> 00:05:13,050
We're going to now install cursor the I IDE which is great.
我们现在要安装 Cursor I IDE，这很棒。

88
00:05:13,050 --> 00:05:13,930
It is fabulous.
太棒了。

89
00:05:13,930 --> 00:05:14,850
And you're going to love it.
你一定会喜欢它的。

90
00:05:14,890 --> 00:05:17,410
If you've already got cursor then of course you can skip this step.
如果您已经有了光标，那么当然可以跳过这一步。

91
00:05:17,650 --> 00:05:20,650
Otherwise bring up your favorite browser and go to cursor.
否则，打开您最喜欢的浏览器并转到光标。

92
00:05:22,090 --> 00:05:25,250
And here we have the screen for installing cursor.
这里我们有安装光标的屏幕。

93
00:05:25,290 --> 00:05:29,610
You will need to begin by creating an account using the sign up button over here.
您需要首先使用此处的注册按钮创建一个帐户。

94
00:05:29,610 --> 00:05:32,250
If you don't have one already and it will just guide you through.
如果您还没有，它只会引导您完成。

95
00:05:32,250 --> 00:05:40,330
I use my Google credentials myself, and I selected a Trial Pro plan myself, which is a free at least
我自己使用我的 Google 凭据，并且我自己选择了 Trial Pro 计划，该计划至少是免费的

96
00:05:40,330 --> 00:05:40,770
for now.
目前。

97
00:05:41,050 --> 00:05:46,130
And I then press download for Mac, which then brings down an installer.
然后我按下 Mac 版的“下载”，然后就会出现一个安装程序。

98
00:05:46,130 --> 00:05:50,890
I then run that installer and it then asks me a couple of questions.
然后我运行该安装程序，然后它问我几个问题。

99
00:05:50,890 --> 00:05:53,810
I log in and then it installs it.
我登录然后它就会安装它。

100
00:05:53,850 --> 00:05:56,490
I mean, I'm sure you are used to these things.
我的意思是，我确信你已经习惯了这些事情。

101
00:05:56,490 --> 00:06:01,900
You then drag and drop into applications and you open that up and it will install it.
然后，您将其拖放到应用程序中，然后打开它，它就会安装它。

102
00:06:01,940 --> 00:06:02,980
Easy peasy.
简单易行。

103
00:06:03,420 --> 00:06:07,540
I selected all of the default setup instructions, nothing special at all.
我选择了所有默认设置说明，没有什么特别的。

104
00:06:07,540 --> 00:06:10,540
And then you should launch it and you should be in cursor.
然后你应该启动它并且你应该处于光标位置。

105
00:06:10,540 --> 00:06:12,740
And that is where we will go next.
这就是我们下一步要去的地方。

106
00:06:13,620 --> 00:06:13,940
Okay.
好的。

107
00:06:13,980 --> 00:06:19,180
So once you've opened up cursor freshly installed this is what it should look like a nice big empty
因此，一旦您打开新安装的光标，它应该看起来像一个漂亮的大空的

108
00:06:19,220 --> 00:06:19,780
screen.
屏幕。

109
00:06:19,780 --> 00:06:23,500
And we're going to press the open project button right here.
我们将在此处按下“打开项目”按钮。

110
00:06:23,780 --> 00:06:30,220
And we're going to then navigate to projects wherever that is.
然后我们将导航到项目，无论它在哪里。

111
00:06:30,220 --> 00:06:36,660
I guess it's going to be at the top projects and then agents, which is the new folder that we've just
我想它将位于顶级项目，然后是代理，这是我们刚刚创建的新文件夹

112
00:06:36,660 --> 00:06:37,100
installed.
安装。

113
00:06:37,100 --> 00:06:39,780
This is known as the project root folder.
这称为项目根文件夹。

114
00:06:39,780 --> 00:06:40,660
Here it is.
这里是。

115
00:06:40,860 --> 00:06:43,100
And then we're going to press open.
然后我们要按下打开键。

116
00:06:43,420 --> 00:06:45,060
And here it is.
就是这样。

117
00:06:45,900 --> 00:06:47,180
Cursor opens up.
光标打开。

118
00:06:47,180 --> 00:06:53,340
We've got a nice screen here that's known as the explorer which shows all of the files organized by
我们这里有一个很好的屏幕，称为资源管理器，它显示了按以下方式组织的所有文件

119
00:06:53,340 --> 00:06:54,180
directories.
目录。

120
00:06:54,180 --> 00:06:55,580
One of these directories might be open.
这些目录之一可能已打开。

121
00:06:55,580 --> 00:06:59,190
You can just click the switch to collapse it like that.
您只需单击开关即可将其折叠起来。

122
00:06:59,230 --> 00:07:02,950
There might be a box up here with some sort of welcome to cursor, blah blah blah.
这里可能会有一个框，上面有某种欢迎光标的信息，等等等等。

123
00:07:02,990 --> 00:07:06,750
Just X out of that extra box on the top left if it's there for you.
如果左上角的那个额外的盒子里有适合你的东西，只需从其中取出 X 即可。

124
00:07:07,110 --> 00:07:11,710
Over here is a chat screen where you can chat with an AI about your code.
这里是一个聊天屏幕，您可以在其中与人工智能讨论您的代码。

125
00:07:11,750 --> 00:07:15,350
And I'm going to suggest for now we x out of that as well to keep things really clean.
我现在建议我们不要这样做，以保持事情真正干净。

126
00:07:15,390 --> 00:07:18,430
So what we're looking at now is a nice big area here.
所以我们现在看到的是这里一个不错的大区域。

127
00:07:18,670 --> 00:07:25,870
And the code the explorer to look at our directories right here, including the Readme and so on.
代码资源管理器就在这里查看我们的目录，包括自述文件等。

128
00:07:25,910 --> 00:07:29,190
And congratulations you are into cursor.
恭喜您进入光标状态。

129
00:07:29,390 --> 00:07:33,070
And that is the second step of the instructions completed.
这就是完成说明的第二步。

130
00:07:33,790 --> 00:07:37,990
And we are now onto step three of the instructions which are my very favorite step where you're going
现在我们进入了说明的第三步，这是我最喜欢的一步

131
00:07:37,990 --> 00:07:38,630
to install.
安装。

132
00:07:38,670 --> 00:07:45,390
You've the package manager which is so fabulous, so quick and easy to use, and you're going to be
您拥有非常棒、快速且易于使用的包管理器，您将会

133
00:07:45,390 --> 00:07:46,870
really happy about this.
对此真的很高兴。

134
00:07:46,870 --> 00:07:52,150
I know it's like another new thing to learn, which is always a pain, but I tell you, it's so great.
我知道这就像要学习另一项新事物，这总是一种痛苦，但我告诉你，它太棒了。

135
00:07:52,190 --> 00:07:58,280
The reason we're doing this is partly because a student on my prior course, said, you know, you really
我们这样做的部分原因是因为我之前课程的一名学生说，你知道，你真的

136
00:07:58,280 --> 00:07:59,240
should use UV.
应使用紫外线。

137
00:07:59,280 --> 00:08:00,560
It's so much better.
好多了。

138
00:08:00,560 --> 00:08:02,120
And so I'd heard of it.
所以我听说过它。

139
00:08:02,120 --> 00:08:07,000
I knew it was doing the rounds, but I hadn't actually used it myself until that, and that pushed me
我知道它正在流行，但在那之前我自己并没有真正使用过它，这推动了我

140
00:08:07,000 --> 00:08:07,520
to do it.
去做它。

141
00:08:07,520 --> 00:08:09,160
And I've never looked back.
我从未回头。

142
00:08:09,200 --> 00:08:15,000
And we'll find that many of the AI platforms, the agent platforms will use or use UV themselves.
我们会发现很多AI平台、代理平台都会使用或者自己使用UV。

143
00:08:15,000 --> 00:08:16,920
So it's going to work out really well for us.
所以这对我们来说会非常顺利。

144
00:08:16,920 --> 00:08:20,640
You're going to be grateful I showed you this if you're not already a UV convert.
如果您还不是紫外线转换者，您会很感激我向您展示了这一点。

145
00:08:20,640 --> 00:08:21,280
All right.
好的。

146
00:08:21,520 --> 00:08:24,360
So first step is to install UV.
所以第一步是安装UV。

147
00:08:24,520 --> 00:08:28,080
And the way you do that is you bring up a browser window.
这样做的方法是打开一个浏览器窗口。

148
00:08:28,240 --> 00:08:32,880
And yeah you can just Google for UV package manager.
是的，你可以通过 Google 搜索 UV 包管理器。

149
00:08:32,880 --> 00:08:39,000
Or you can look at the link that I'll have in the instructions, and you'll see that there is the um
或者您可以查看我在说明中提供的链接，您会看到有 um

150
00:08:39,400 --> 00:08:40,560
link to the GitHub.
链接到 GitHub。

151
00:08:40,600 --> 00:08:44,720
And it has within it some clear installation instructions.
其中有一些明确的安装说明。

152
00:08:44,720 --> 00:08:50,920
You just simply have to run this one command in a terminal, and I will copy that to the clipboard.
您只需在终端中运行这个命令，我会将其复制到剪贴板。

153
00:08:50,920 --> 00:08:51,680
There it is.
就在那里。

154
00:08:52,000 --> 00:08:56,770
Now there's actually a new easy way to run things in a terminal because you can do it within cursor.
现在实际上有一种新的简单方法可以在终端中运行，因为您可以在光标内执行此操作。

155
00:08:56,810 --> 00:08:59,210
Here's my cursor screen again.
这又是我的光标屏幕。

156
00:08:59,210 --> 00:09:01,610
And there's actually a view menu.
实际上有一个视图菜单。

157
00:09:01,610 --> 00:09:03,770
And you can go view and then terminal.
你可以去查看然后终端。

158
00:09:03,770 --> 00:09:09,170
Or you can know to press the control button not the command button, not the one with the squiggle clover
或者你可以知道按控制按钮而不是命令按钮，而不是带有波浪线三叶草的按钮

159
00:09:09,170 --> 00:09:13,210
on it, but the control button on the bottom left of your keyboard control.
就在上面，而是键盘控制左下角的控制按钮。

160
00:09:13,210 --> 00:09:16,330
And then the tick mark on the top left of your keyboard.
然后是键盘左上角的勾号。

161
00:09:16,370 --> 00:09:17,570
Or at least on my keyboard.
或者至少在我的键盘上。

162
00:09:17,610 --> 00:09:18,770
And up comes a terminal.
然后出现了一个终端。

163
00:09:18,770 --> 00:09:21,370
But you could also go to the view menu and choose terminal.
但您也可以转到查看菜单并选择终端。

164
00:09:21,370 --> 00:09:22,330
And here it is.
就是这样。

165
00:09:22,370 --> 00:09:27,250
And now you can simply paste in that command to run the installation for you've.
现在您只需粘贴该命令即可运行安装。

166
00:09:27,250 --> 00:09:29,170
And it will be super quick and you'll be done.
它会非常快，你就会完成。

167
00:09:29,170 --> 00:09:30,970
I'm not going to run it because I've already run it.
我不会运行它，因为我已经运行了它。

168
00:09:31,330 --> 00:09:36,370
Once you've done that, you might need to close this terminal by pressing the the X, and you might
完成此操作后，您可能需要按 X 关闭此终端，并且您可能

169
00:09:36,370 --> 00:09:41,850
actually need to to quit out of right right out of cursor and bring back up cursor because it needs
实际上需要退出光标并恢复光标，因为它需要

170
00:09:41,850 --> 00:09:43,770
to refresh its environment variables.
刷新其环境变量。

171
00:09:43,770 --> 00:09:48,850
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，它应该给你一个版本号

172
00:09:48,850 --> 00:09:52,690
which is telling you that all is good, UV is installed.
这告诉您一切都很好，UV 已安装。

173
00:09:53,090 --> 00:09:57,100
And uh, with that we are almost ready to go.
呃，这样我们就差不多准备好了。

174
00:09:57,140 --> 00:09:59,380
There is now only one command left.
现在只剩下一个命令了。

175
00:10:00,060 --> 00:10:01,380
And what is that command?
那是什么命令？

176
00:10:01,420 --> 00:10:02,100
I hear you ask.
我听到你问。

177
00:10:02,100 --> 00:10:04,180
It is simply to type at this point.
此时只需键入即可。

178
00:10:04,220 --> 00:10:07,060
You see like that.
你看就是这样。

179
00:10:07,100 --> 00:10:12,540
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 版本

180
00:10:12,540 --> 00:10:17,820
file and a pyproject.toml and some other things and a UV lock.
文件和 pyproject.toml 以及其他一些东西和 UV 锁。

181
00:10:17,860 --> 00:10:22,220
And it's going to use that to build our environment and let's see it doing that.
它将使用它来构建我们的环境，让我们看看它是如何做到的。

182
00:10:22,220 --> 00:10:23,100
Off it goes.
关了就走了。

183
00:10:23,460 --> 00:10:28,020
Now I told you that it's quick and you'll see that it was very quick.
现在我告诉你它很快，你会发现它非常快。

184
00:10:28,180 --> 00:10:29,660
That is just done.
那是刚刚完成的。

185
00:10:29,660 --> 00:10:32,020
But that's actually quicker than it will be for you.
但这实际上比您要快。

186
00:10:32,060 --> 00:10:34,900
And it's that quick because it does cache things that I've done before.
它之所以那么快，是因为它确实缓存了我之前做过的事情。

187
00:10:35,140 --> 00:10:39,340
When you do this, it's going to take about three minutes, four minutes, which is still very quick
当你这样做的时候，大约需要三分钟、四分钟，还是很快的

188
00:10:39,340 --> 00:10:42,780
because Anaconda takes like an hour or something.
因为 Anaconda 大约需要一个小时左右。

189
00:10:42,900 --> 00:10:47,660
So it's going to be fast, but there is still a lot to be installed, so you'll have to sit back and
所以它会很快，但仍然有很多东西需要安装，所以你必须坐下来

190
00:10:47,660 --> 00:10:54,980
wait while everything installs, but enjoy the raw power of UV as everything gets built there And once
等待一切安装完毕，但当所有东西都在那里建造时，请享受紫外线的原始力量一次

191
00:10:54,980 --> 00:10:57,660
it's done, what you may notice is that there's a new.
完成了，您可能会注意到有一个新的。

192
00:10:57,700 --> 00:11:03,620
Directory called dot that's appeared, which is like a traditional Python virtual environment.
出现了一个叫做dot的目录，它就像一个传统的Python虚拟环境。

193
00:11:03,620 --> 00:11:07,220
If you know these things that it's created one for this project.
如果你知道这些事情，它就会为这个项目创建一个。

194
00:11:07,220 --> 00:11:11,660
And so one of the really nice things about UV is that it's compatible and consistent with all of the
因此，UV 的真正好处之一是它与所有的兼容和一致

195
00:11:11,660 --> 00:11:13,500
other ways you do things in Python.
在 Python 中执行操作的其他方式。

196
00:11:13,500 --> 00:11:16,460
It's not like there's a new sort of thing like Conda.
并不是有像 Conda 这样的新东西。

197
00:11:16,660 --> 00:11:23,140
So it's that's been set up and now that is going to be the environment that we'll be using from this
所以它已经设置好了，现在这将是我们将要使用的环境

198
00:11:23,140 --> 00:11:24,140
point onwards.
点向前。

199
00:11:24,300 --> 00:11:30,260
And when you run a Python script, whereas before you might have typed Python and then something, what
当你运行 Python 脚本时，而之前你可能已经输入了 Python，然后输入了一些东西，什么

200
00:11:30,260 --> 00:11:36,580
you're going to type now is you've run and then that same thing and that automatically makes sure that
你现在要输入的是你已经运行了，然后是同样的事情，这会自动确保

201
00:11:36,580 --> 00:11:38,780
it runs in that environment.
它在该环境中运行。

202
00:11:39,180 --> 00:11:44,620
The other thing to mention is that it has installed a dedicated version of Python, right?
另外值得一提的是，它已经安装了专用版本的Python，对吧？

203
00:11:44,620 --> 00:11:45,700
For this project.
对于这个项目。

204
00:11:45,700 --> 00:11:48,340
It is in fact a Python version 3.1.
它实际上是 Python 3.1 版本。

205
00:11:48,860 --> 00:11:51,940
Uh, whilst the latest version of Python is 3.13.
呃，Python 的最新版本是 3.13。

206
00:11:51,980 --> 00:11:53,180
That's not yet not.
那还不是。

207
00:11:53,180 --> 00:11:55,550
Not all data science packages are ready for that yet.
并非所有数据科学包都已为此做好准备。

208
00:11:55,550 --> 00:11:59,790
So 3.1 is what we're using and everything will be in that Python.
所以我们正在使用 3.1，所有内容都将在该 Python 中。

209
00:11:59,790 --> 00:12:03,630
It will have installed it for you if you didn't already have it, and it will be dedicated for this
如果您还没有安装它，它会专门为您安装

210
00:12:03,630 --> 00:12:04,230
project.
项目。

211
00:12:04,270 --> 00:12:05,590
UV is really good.
紫外线真的很好。

212
00:12:05,590 --> 00:12:13,630
It combines this kind of isolated environment with something that is fast and simple, and I very much
它将这种孤立的环境与快速简单的东西结合起来，我非常喜欢

213
00:12:13,630 --> 00:12:16,190
hope that this will have simply worked for you.
希望这对你有用。

214
00:12:16,190 --> 00:12:20,110
And that means that step three is done and we can move on to step four.
这意味着第三步已经完成，我们可以继续第四步。

215
00:12:20,710 --> 00:12:24,670
So for step four, we're going to set up a key with OpenAI.
因此，对于第四步，我们将使用 OpenAI 设置密钥。

216
00:12:25,190 --> 00:12:31,670
Now again I want to emphasize that whilst I do encourage you to be setting up a key with OpenAI and
现在我想再次强调，虽然我确实鼓励您使用 OpenAI 设置密钥，

217
00:12:31,670 --> 00:12:35,870
to be using that API, it is not required for this project for this course.
要使用该 API，本课程的项目不需要使用该 API。

218
00:12:35,870 --> 00:12:39,310
And there are alternatives in the Readme, but that's what we're going to do now.
自述文件中有其他选择，但这就是我们现在要做的。

219
00:12:39,350 --> 00:12:42,070
I'm going to assume that you are good for this and that we can come in.
我假设你很擅长这个，我们可以加入。

220
00:12:42,070 --> 00:12:48,150
And so you go to platform dot Openai.com just here like that.
因此，您可以像这样访问 Openai.com 平台。

221
00:12:48,310 --> 00:12:55,160
And this brings you to the front screen of OpenAI where you get to set up an account.
这会将您带到 OpenAI 的前屏幕，您可以在其中设置帐户。

222
00:12:55,160 --> 00:12:59,280
If you don't have one already, sign up or log in if you have one.
如果您还没有，请注册或登录（如果您有）。

223
00:12:59,280 --> 00:13:01,880
And I'm going to log in because I already have one.
我要登录，因为我已经有了一个。

224
00:13:02,000 --> 00:13:04,480
Log in with my Google credentials.
使用我的 Google 凭据登录。

225
00:13:04,480 --> 00:13:06,920
And here we have my account.
这里有我的帐户。

226
00:13:06,920 --> 00:13:09,840
We're logged in and you will hopefully have done the same.
我们已登录，希望您也已登录。

227
00:13:09,880 --> 00:13:11,400
Let me make this nice and big for you.
让我为你把这个变得又漂亮又大。

228
00:13:12,320 --> 00:13:13,040
Okay.
好的。

229
00:13:13,200 --> 00:13:17,240
So there are now two things that we have to do now that we're in OpenAI.
因此，现在我们在 OpenAI 中必须做两件事。

230
00:13:17,240 --> 00:13:22,360
And we're going to go and do both of them now bearing in mind this is not required, you can also do
我们现在要去做这两件事，记住这不是必需的，你也可以这样做

231
00:13:22,360 --> 00:13:27,720
the same thing, this analogous website for deep seek and for many others, you could be setting up
同样的事情，这个类似的网站用于深度搜索和许多其他网站，您可以建立

232
00:13:27,720 --> 00:13:31,720
your keys in any of them and just follow the same kind of process.
将您的密钥放入其中任何一个中，然后遵循相同的过程即可。

233
00:13:31,720 --> 00:13:33,040
But let's get to that now.
但现在让我们开始吧。

234
00:13:33,600 --> 00:13:35,000
So as I say, it's two steps.
正如我所说，这是两个步骤。

235
00:13:35,000 --> 00:13:40,000
The first of them is to go to the settings menu up here and come down to billing.
第一个是进入此处的设置菜单并进行计费。

236
00:13:40,000 --> 00:13:43,440
And this is where you set up your billing details.
您可以在此处设置帐单详细信息。

237
00:13:43,600 --> 00:13:48,600
Now you have to apply a credit balance giving OpenAI some money in advance.
现在你必须申请信用余额，提前给 OpenAI 一些钱。

238
00:13:48,600 --> 00:13:52,930
And I've given it quite a lot of money right here because I'm doing various different things and you
我在这里给了它很多钱，因为我正在做各种不同的事情，而你

239
00:13:52,930 --> 00:13:55,690
do not need to give it that much money by any means.
无论如何都不需要给它那么多钱。

240
00:13:55,970 --> 00:13:57,690
There is a minimum top up.
有最低充值限额。

241
00:13:57,690 --> 00:14:02,330
They require at least $5 as of right now, but they are.
截至目前，他们至少需要 5 美元，但事实确实如此。

242
00:14:02,690 --> 00:14:04,370
They sometimes have deals.
他们有时会有优惠。

243
00:14:04,410 --> 00:14:06,490
There's something going on down here that you could read about.
这里正在发生一些事情，您可以阅读一下。

244
00:14:06,490 --> 00:14:11,850
Perhaps there's some some deal for free tokens right now, but there's different deals and you can press
也许现在有一些免费代币的交易，但有不同的交易，您可以按

245
00:14:11,850 --> 00:14:15,610
the Add to credit balance to put in your $5 up front.
添加到信用余额以预先存入 5 美元。

246
00:14:15,650 --> 00:14:18,130
That's that's, I believe, required right now.
我相信，这就是现在所需要的。

247
00:14:18,370 --> 00:14:22,890
And we'll only spend a few dollars of that on this course, and that you have complete flexibility and
我们只会在这门课程上花费几美元，并且您拥有完全的灵活性和

248
00:14:22,890 --> 00:14:28,050
you can come back and watch to what extent you're spending your credits as we go through.
您可以回来看看您在我们讨论的过程中花费了多少积分。

249
00:14:28,210 --> 00:14:30,850
But but I suggest doing that, putting in your $5.
但我建议这样做，投入 5 美元。

250
00:14:30,850 --> 00:14:33,850
But bear in mind, if you don't want to, you don't need to.
但请记住，如果您不想，则不需要。

251
00:14:34,090 --> 00:14:37,650
Once you've done that, you then turn to the API keys.
完成此操作后，您将转向 API 密钥。

252
00:14:37,690 --> 00:14:44,250
Part of this, which is where you get to see the key that you've set up that you will use for this project.
其中一部分是您可以看到您设置的将用于该项目的密钥的地方。

253
00:14:44,530 --> 00:14:49,210
And if you already have a key, then then great, you're in good shape, but I assume you don't, in
如果你已经有钥匙了，那就太好了，你的状态很好，但我认为你没有，在

254
00:14:49,210 --> 00:14:50,770
which case you press this green.
在这种情况下你按这个绿色。

255
00:14:50,770 --> 00:14:53,100
Create new secret key.
创建新的密钥。

256
00:14:53,460 --> 00:14:56,420
You leave, you give it a name that just doesn't matter.
你离开，你给它起一个无关紧要的名字。

257
00:14:56,420 --> 00:14:57,900
Just for your future reference.
仅供您以后参考。

258
00:14:57,900 --> 00:15:03,980
And then for projects, be sure to choose default Project and leave it as all permissions and then press
然后对于项目，请务必选择默认项目并将其保留为所有权限，然后按

259
00:15:03,980 --> 00:15:05,940
Create Secret Key.
创建密钥。

260
00:15:06,300 --> 00:15:07,540
It's then going to prompt you.
然后它会提示你。

261
00:15:07,540 --> 00:15:09,980
It's going to bring up your key that you'll use.
它将显示您将使用的密钥。

262
00:15:09,980 --> 00:15:11,940
And you can copy it into your clipboard.
您可以将其复制到剪贴板中。

263
00:15:11,980 --> 00:15:16,340
And we're going to paste it in a moment into cursor in a place where we were going to use it.
我们稍后将把它粘贴到光标中我们要使用它的地方。

264
00:15:16,740 --> 00:15:17,900
Now here's the thing.
现在事情是这样的。

265
00:15:17,900 --> 00:15:20,900
Here is a nasty gotcha to be aware of.
这里有一个需要注意的棘手问题。

266
00:15:21,180 --> 00:15:27,500
It's very tempting to take your key and paste it into a useful app, like, like the notepad or something,
很容易将您的密钥粘贴到有用的应用程序中，例如记事本或其他应用程序，

267
00:15:27,780 --> 00:15:30,260
but there's a trap there you need to be careful of.
但那里有一个陷阱你需要小心。

268
00:15:30,460 --> 00:15:33,140
Some programs, I think, including notepad.
我认为有些程序包括记事本。

269
00:15:33,300 --> 00:15:39,660
If you paste in some text and then press enter, it changes some of the characters in that text to be
如果您粘贴某些文本然后按 Enter 键，则会将该文本中的某些字符更改为

270
00:15:39,660 --> 00:15:45,340
nicer, formatted like it turns hyphens into long hyphens, and that can be really hard to spot.
更好，格式就像将连字符变成长连字符，这真的很难发现。

271
00:15:45,340 --> 00:15:48,140
And that will then basically invalidate your key.
这基本上会使你的密钥失效。

272
00:15:48,180 --> 00:15:52,630
Your key will now be a different set of letters or characters, and when you try and use that in your
您的密钥现在将是一组不同的字母或字符，当您尝试在您的应用程序中使用它时

273
00:15:52,630 --> 00:15:56,550
file, it's going to fail and it's going to be almost impossible to track it down because it's going
文件，它将会失败并且几乎不可能追踪它，因为它正在

274
00:15:56,590 --> 00:15:57,430
to look perfect.
看起来很完美。

275
00:15:57,430 --> 00:15:58,790
And it's really frustrating.
这真的很令人沮丧。

276
00:15:58,790 --> 00:16:00,910
And a lot of people have had that problem.
很多人都遇到过这个问题。

277
00:16:00,910 --> 00:16:06,670
So I urge you just to copy it into the clipboard and paste it straight into cursor in the next step.
因此，我建议您将其复制到剪贴板中，然后在下一步中将其直接粘贴到光标中。

278
00:16:06,790 --> 00:16:09,070
And it is good to to keep a copy of it somewhere.
最好将其副本保存在某个地方。

279
00:16:09,070 --> 00:16:14,310
Just be really careful to make sure you do it in a way that doesn't overwrite your characters, so that
只是要非常小心，确保你这样做的方式不会覆盖你的角色，这样

280
00:16:14,310 --> 00:16:18,270
you're keeping the original and and it feels in good shape.
你保留了原件，而且感觉状态良好。

281
00:16:18,270 --> 00:16:23,390
So there is my, uh, public service announcement about about things to watch out for with keys.
我的，呃，公共服务公告是关于使用钥匙时需要注意的事项。

282
00:16:23,390 --> 00:16:29,070
But hopefully you've set up your key, you've copied it to the clipboard, you've maybe made a backup
但希望你已经设置了你的密钥，你已经将它复制到剪贴板，你可能已经做了备份

283
00:16:29,070 --> 00:16:30,350
somewhere safe.
安全的地方。

284
00:16:30,550 --> 00:16:32,630
And now we're ready for the next part.
现在我们已经准备好进行下一部分了。

285
00:16:33,270 --> 00:16:36,230
And this is step five of the environment set up.
这是环境设置的第五步。

286
00:16:36,230 --> 00:16:37,030
And it's the last step.
这是最后一步。

287
00:16:37,030 --> 00:16:38,470
We're almost completely done.
我们几乎完全完成了。

288
00:16:38,470 --> 00:16:41,270
We're back in cursor again looking at cursor.
我们再次回到光标处查看光标。

289
00:16:41,430 --> 00:16:45,270
And I'm just going to I'm going to press an X here to get rid of that screen.
我只是要按一下 X 来删除该屏幕。

290
00:16:45,270 --> 00:16:47,550
I'm going to press an X to get rid of my terminal.
我要按 X 来删除我的终端。

291
00:16:47,550 --> 00:16:50,510
So we're looking at a nice clean page here.
所以我们在这里看到一个漂亮的干净页面。

292
00:16:50,920 --> 00:16:51,320
now.
现在。

293
00:16:51,360 --> 00:16:53,280
Down here in the explorer.
在探险家的下面。

294
00:16:53,320 --> 00:16:55,160
I've collapsed all these folders.
我已经折叠了所有这些文件夹。

295
00:16:55,160 --> 00:16:59,840
I'm going to right click and say new file at the bottom here.
我将右键单击并在此处底部说出新文件。

296
00:16:59,840 --> 00:17:01,520
And I'm going to create a new file.
我将创建一个新文件。

297
00:17:01,520 --> 00:17:03,720
And I'm going to give it a very precise name.
我将给它一个非常精确的名称。

298
00:17:03,720 --> 00:17:06,200
And you have to give it exactly the same name.
并且您必须为其指定完全相同的名称。

299
00:17:06,200 --> 00:17:09,960
If you get this wrong by a single character, then you're going to have problems later.
如果你在一个字符上犯了错误，那么你以后就会遇到问题。

300
00:17:10,000 --> 00:17:11,880
So so be careful with this one.
所以这一点一定要小心。

301
00:17:11,880 --> 00:17:19,200
It starts with a dot, the period, a full stop, and then the letters E, dot, E, env.
它以点、句号、句号开头，然后是字母 E、点、E、env。

302
00:17:19,200 --> 00:17:21,520
And it's got to be called exactly that.
它必须被准确地称为这个。

303
00:17:21,760 --> 00:17:23,120
And you'll see why later.
稍后您就会明白原因。

304
00:17:23,120 --> 00:17:30,080
But basically this this is a file which is often used to store environment variables, things that will
但基本上这是一个经常用来存储环境变量的文件，

305
00:17:30,080 --> 00:17:36,080
load into our environment as variables that we'll use for things like passwords and tokens and keys.
作为变量加载到我们的环境中，我们将使用这些变量来存储密码、令牌和密钥等内容。

306
00:17:36,240 --> 00:17:38,760
And it doesn't get checked into GitHub.
而且它不会被签入 GitHub。

307
00:17:38,760 --> 00:17:42,400
So it stays as a private file just for you.
因此，它会保留为您的私人文件。

308
00:17:42,400 --> 00:17:45,080
And it's a common technique for managing these kinds of things.
这是管理此类事情的常用技术。

309
00:17:45,120 --> 00:17:46,520
And it's called dot env.
它被称为 dot env。

310
00:17:46,520 --> 00:17:47,960
And it has to be called exactly that.
它必须被准确地称为。

311
00:17:48,320 --> 00:17:53,730
So what we can now do is type into here a key that we want to to remember.
所以我们现在可以做的就是在这里输入我们想要记住的密钥。

312
00:17:53,730 --> 00:17:57,530
And in particular the one that we want to remember is OpenAI's key.
我们特别要记住的是 OpenAI 的密钥。

313
00:17:57,650 --> 00:18:01,650
And it's it's OpenAI underscore API underscore key.
它是 OpenAI 下划线 API 下划线键。

314
00:18:01,650 --> 00:18:05,490
And it's actually prompting me right here for it because cursor is that clever and knows what we're
它实际上在这里提示我，因为光标很聪明并且知道我们在做什么

315
00:18:05,490 --> 00:18:06,050
trying to do.
试图做。

316
00:18:06,090 --> 00:18:08,450
And we can just press Tab to fill it all the way in.
我们只需按 Tab 键即可将其全部填充。

317
00:18:08,450 --> 00:18:09,370
But I'm not going to do that.
但我不会那样做。

318
00:18:09,370 --> 00:18:17,450
I am going to type OpenAI API key equals no quote marks, no spaces, no spaces before or after and
我要输入 OpenAI API key 等于没有引号、没有空格、前后没有空格以及

319
00:18:17,450 --> 00:18:17,850
people.
人们。

320
00:18:17,850 --> 00:18:25,130
One common mistake is that sometimes people say open API key or OpenAI key, but it's not that it's
一个常见的错误是，有时人们说开放 API 密钥或 OpenAI 密钥，但事实并非如此。

321
00:18:25,130 --> 00:18:26,810
OpenAI API key.
OpenAI API 密钥。

322
00:18:26,810 --> 00:18:28,290
And it's got to be exactly this.
一定是这样的。

323
00:18:28,290 --> 00:18:31,930
I think this is one of the only things in this course where every letter needs to be right.
我认为这是本课程中唯一要求每个字母都正确的事情之一。

324
00:18:31,970 --> 00:18:33,410
And so be careful.
所以要小心。

325
00:18:33,410 --> 00:18:37,810
This is like 90% of the reason that people are frustrated in environment setup.
这就像人们在环境设置中感到沮丧的 90% 原因。

326
00:18:37,810 --> 00:18:39,450
Is this this very file.
这就是这个文件吗？

327
00:18:39,890 --> 00:18:40,410
All right.
好的。

328
00:18:40,410 --> 00:18:47,090
What comes next is you simply paste in here exactly the key that came from OpenAI.
接下来，您只需将来自 OpenAI 的密钥粘贴到此处即可。

329
00:18:47,090 --> 00:18:55,980
And it should begin ESC dash proj dash, and then a bunch of letters and numbers with maybe an underscore
它应该以 ESC dash proj dash 开头，然后是一堆字母和数字，可能带有下划线

330
00:18:56,020 --> 00:18:56,940
symbol as well.
符号也是如此。

331
00:18:56,940 --> 00:18:58,180
And that should all come there.
这一切都应该发生。

332
00:18:58,220 --> 00:19:06,260
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，然后

333
00:19:06,260 --> 00:19:09,220
another SK proj or anything like that that some people have done.
另一个 SK 项目或者一些人做过的类似的事情。

334
00:19:09,220 --> 00:19:10,580
It's got to be just right.
一定要恰到好处。

335
00:19:10,580 --> 00:19:14,340
Sorry to go on about it, but this is such a cause of problems.
很抱歉继续说下去，但这就是问题的根源。

336
00:19:14,340 --> 00:19:19,740
So so make sure that that key, the thing that's showing in purple here, is exactly the key that you
因此，请确保该键（此处显示为紫色的东西）正是您要使用的键。

337
00:19:19,740 --> 00:19:20,820
took from open AI.
取自开放人工智能。

338
00:19:20,820 --> 00:19:22,340
And it should look perfect.
它看起来应该很完美。

339
00:19:22,340 --> 00:19:26,180
And once you've done that you do command S to save this file.
完成后，您可以使用命令 S 来保存该文件。

340
00:19:26,180 --> 00:19:28,260
And you'll be in great shape.
而且你会保持良好的状态。

341
00:19:29,340 --> 00:19:35,300
And at that point that will then be the end of step five of the environment setup.
到那时，环境设置的第五步就结束了。

342
00:19:35,300 --> 00:19:40,260
We will have done environment setup and we're good to get into the to the actual project.
我们将完成环境设置，并且很高兴进入实际项目。

343
00:19:40,300 --> 00:19:41,020
How about that.
怎么样？

344
00:19:41,020 --> 00:19:42,380
So congratulations.
所以恭喜你。

345
00:19:42,380 --> 00:19:42,780
Thank you.
谢谢。

346
00:19:42,820 --> 00:19:44,100
Hopefully this is now all going to work.
希望这一切现在都能发挥作用。

347
00:19:44,100 --> 00:19:45,180
We'll soon find out.
我们很快就会知道。

348
00:19:45,180 --> 00:19:49,700
I will see you in the next lecture when we reconvene with team PC.
当我们与 PC 团队重聚时，我们将在下一次讲座中与您见面。
