如果您想了解如何与他人实时编辑GoogleColab笔记本?的相关知识,那么本文是一篇不可错过的文章,我们将对googledocs怎么让别人编辑进行全面详尽的解释,并且为您提供关于Colab/Cola
如果您想了解如何与他人实时编辑 Google Colab 笔记本?的相关知识,那么本文是一篇不可错过的文章,我们将对google docs怎么让别人编辑进行全面详尽的解释,并且为您提供关于Colab/Colab Pro:重新连接后无法检索文件、Conda Colab 错误收集包元数据 (current_repodata.json):失败 InvalidVersionSpec:无效版本“4.19.112+”:空版本组件 如何在 Colab 中轻松完成此操作、download file by python in google colab、Google Colab - 导出包含 Colab Widgets UI 的单元格输出的有价值的信息。
本文目录一览:- 如何与他人实时编辑 Google Colab 笔记本?(google docs怎么让别人编辑)
- Colab/Colab Pro:重新连接后无法检索文件
- Conda Colab 错误收集包元数据 (current_repodata.json):失败 InvalidVersionSpec:无效版本“4.19.112+”:空版本组件 如何在 Colab 中轻松完成此操作
- download file by python in google colab
- Google Colab - 导出包含 Colab Widgets UI 的单元格输出
如何与他人实时编辑 Google Colab 笔记本?(google docs怎么让别人编辑)
如何解决如何与他人实时编辑 Google Colab 笔记本?
我想使用 Google Colab 进行实时编辑,就像在 Google 表格中一样,可以立即看到其他人在做什么。我想知道这是否也可以通过进行一些配置在 Google Colab 上实现,因为我正在尝试与我的朋友一起编辑一个代码,但我们的更改不会相互显示。 他的更改在几秒钟后才会显示,发生时页面会自动转到顶部。
Colab/Colab Pro:重新连接后无法检索文件
如何解决Colab/Colab Pro:重新连接后无法检索文件
非常感谢您的帮助。
这个问题已经持续一年多了。设置运行时等没问题,但如果我不看管计算机,让运行时断开连接,当我重新登录时,我很少能在我的 Google Drive 中找到输出文件。下载的库等都还在那里,这很奇怪。只有临时输出文件夹和输出文件消失了。
我尝试过使用 colab 常规和 Colab Pro、不同的电子邮件/驱动器帐户、不同的计算机、退出所有其他帐户......
另外,单独,我会再做一个关于这个的票,不管我授权多少次,我仍然不能自动下载多个文件。
请帮忙!我是个菜鸟,所以不要以为我知道很多,但我愿意写脚本,不惜一切代价。
非常感谢!
Conda Colab 错误收集包元数据 (current_repodata.json):失败 InvalidVersionSpec:无效版本“4.19.112+”:空版本组件 如何在 Colab 中轻松完成此操作
如何解决Conda Colab 错误收集包元数据 (current_repodata.json):失败 InvalidVersionSpec:无效版本“4.19.112+”:空版本组件 如何在 Colab 中轻松完成此操作
浏览器:Google Chrome 最新版
我按照这篇 Conda + Google Colab 文章在 colab 中设置 conda,几天前它运行良好。
在那之后,我尝试设置FairMOT 通过运行这些命令
!conda create -n FairMOT --yes
!conda activate FairMOT --yes
!conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch --yes
现在,这是我收到的错误输出。
CommandNotFoundError: Your shell has not been properly configured to use ''conda deactivate''.
To initialize your shell,run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See ''conda init --help'' for more information and options.
IMPORTANT: You may need to close and restart your shell after running ''conda init''.
Collecting package Metadata (current_repodata.json): Failed
InvalidVersionSpec: Invalid version ''4.19.112+'': empty version component
CommandNotFoundError: Your shell has not been properly configured to use ''conda activate''.
To initialize your shell,run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See ''conda init --help'' for more information and options.
IMPORTANT: You may need to close and restart your shell after running ''conda init''.
Collecting package Metadata (current_repodata.json): Failed
InvalidVersionSpec: Invalid version ''4.19.112+'': empty version component
Notebook Link
解决方法
我创建了一个有效的快速修复。我不建议将此作为长期解决方案。
更改引发 InvalidVersionSpec
错误的文件的内容。就我而言,这是文件 /usr/local/lib/python3.7/site-packages/conda/models/version.py。您可以使用 !conda create your_env --verbose
为您的案例获取此文件的位置。 (请注意,一个文件生成了异常,但另一个文件引发了 InvalidVersionSpec
,请选择后者)。
以下是我们感兴趣的代码行:
# imports...
# Class definitions...
@with_metaclass(SingleStrArgCachingType)
class VersionOrder(object):
# ...
def __init__(self,vstr):
# ...
# The following line is raising the Exception:
if not c:
raise InvalidVersionSpec(vstr,"empty version component")
在类 __init__
的 VersionOrder
方法的第一行添加以下内容:
if isinstance(vstr,str) and vstr == ''4.19.112+'':
vstr = ''4.19.112''
所以它看起来像这样:
# imports...
# Class definitions...
@with_metaclass(SingleStrArgCachingType)
class VersionOrder(object):
# ...
def __init__(self,vstr):
if isinstance(vstr,str) and vstr == ''4.19.112+'': # Added code
vstr = ''4.19.112''
# ...
# The following line is raising the Exception:
if not c:
raise InvalidVersionSpec(vstr,"empty version component")
正在发生的事情基本上是从版本名称中删除 +
。它会产生错误,因此它可能是版本规范的拼写错误,或者是 conda 的 VersionOrder
类处理此语法时的错误。我建议将此解决方案作为快速修复,以避免对这两个文件产生副作用。
如何在 Colab 中轻松完成此操作
使用 cat 打印文件的内容/usr/local/lib/python3.7/site-packages/conda/models/version.py:
!cat /usr/local/lib/python3.7/site-packages/conda/models/version.py
使用剪贴板复制内容并将它们粘贴到以魔术命令 %%file my_new_version_file.py
开头的新代码单元中:
%%file my_new_version_file.py
# Paste your clipboard here
接下来,在这个新单元格中添加前面提到的代码并运行它。 这将创建一个包含单元格内容的文件 my_new_version_file.py。
然后使用shutil
将生成的文件移动到原始文件的路径中:
import shutil
shutil.move(''my_new_version_file.py'',''/usr/local/lib/python3.7/site-packages/conda/models/version.py'')
download file by python in google colab
https://stackoverflow.com/questions/15352668/download-and-decompress-gzipped-file-in-memory
You need to seek to the beginning of compressedFile
after writing to it but before passing it to gzip.GzipFile()
. Otherwise it will be read from the end by gzip
module and will appear as an empty file to it. See below:
#! /usr/bin/env python
import urllib2
import StringIO
import gzip
baseURL = "https://www.kernel.org/pub/linux/docs/man-pages/"
filename = "man-pages-3.34.tar.gz"
outFilePath = "man-pages-3.34.tar"
response = urllib2.urlopen(baseURL + filename)
compressedFile = StringIO.StringIO()
compressedFile.write(response.read())
#
# Set the file''s current position to the beginning
# of the file so that gzip.GzipFile can read
# its contents from the top.
#
compressedFile.seek(0)
decompressedFile = gzip.GzipFile(fileobj=compressedFile, mode=''rb'')
with open(outFilePath, ''w'') as outfile:
outfile.write(decompressedFile.read())
https://stackoverflow.com/questions/11914472/stringio-in-python3
Google Colab - 导出包含 Colab Widgets UI 的单元格输出
如何解决Google Colab - 导出包含 Colab Widgets UI 的单元格输出
在 Google Colab 笔记本中,我想导出包含网格(Colab Widgets)的单元格输出。网格包含丰富的显示界面 (display()
) 和标准输出 (print()
)。
我尝试使用魔法命令 %%capture
,但我找不到同时导出富显示 UI 和标准输出的方法。
例如,我在下面创建了一个网格输出,我想导出它。
但是,当我使用 %%capture
显示输出时,文本超出了网格。
我还尝试将 Colab notebook 导出为 .ipynb 文件,以便我可以使用 Jupyter Notebook 环境导出单元格。但是,在 Jupyter Notebook 环境中无法正确呈现单元格。
感谢有关在 Colab 笔记本中导出包含网格(Colab 小部件)的单元格输出的指导。
今天的关于如何与他人实时编辑 Google Colab 笔记本?和google docs怎么让别人编辑的分享已经结束,谢谢您的关注,如果想了解更多关于Colab/Colab Pro:重新连接后无法检索文件、Conda Colab 错误收集包元数据 (current_repodata.json):失败 InvalidVersionSpec:无效版本“4.19.112+”:空版本组件 如何在 Colab 中轻松完成此操作、download file by python in google colab、Google Colab - 导出包含 Colab Widgets UI 的单元格输出的相关知识,请在本站进行查询。
本文标签: