我使用以下命令尝试克隆存储库,但不幸的是弹出以下错误。我不能再走了
ubuntu@ip-add-rr-ee-ss:~$ git clone https://github.com/repo/file.git
Cloning into 'file'...
fatal: unable to access 'https://github.com/repo/file.git/': Could not resolve host: github.com
答案 0 :(得分:0)
无法解析主机
这一定是由于EC2实例上的DNS问题引起的(我可以在这里看到您正在使用Ubuntu)
curl
测试与该URL的连接cat /etc/resolv.conf
vi /etc/resolv.conf
[Esc]
并输入:wq
来保存文件答案 1 :(得分:0)
将以下内容添加到我的组安全设置的出站连接中后,我便解决了该问题:
class Example:
def __init__(self, start, end):
self.start = start
self.end = end
self.resume_point = 0
def __iter__(self):
return self
def __next__(self):
if self.resume_point == 0:
# simulates the beginning of your generator function
self.num = self.start
# simulates checking the `while` loop condition
if self.num <= self.end:
# next time we should continue from the `yield`
self.resume_point = 1
# `return` simulates pausing the generator function
return self.num
# simulates the end of your generator function
self.resume_point = 2
raise StopIteration
elif self.resume_point == 1:
# simulates continuing from the `yield` in your generator function
self.num += 1
# simulates checking the `while` loop condition
if self.num <= self.end:
# redundant, but it shows what happens
self.resume_point = 1
# `return` simulates pausing the generator function
return self.num
# simulates the end of your generator function
self.resume_point = 2
raise StopIteration
elif self.resume_point == 2:
# simulates resuming from after your generator function returned
self.resume_point = 2
raise StopIteration
这也解决了我的sudo yum安装问题。