【问题标题】:Cannot install Google Colab locally无法在本地安装 Google Colab
【发布时间】:2021-04-12 04:45:28
【问题描述】:

我一直在尝试在我的计算机(操作系统 Windows)上安装 google-colab,但没有成功。

我运行“pip install google-colab”时的输出很长,但我收到的一些错误是:

> Building wheel for pandas (setup.py) ... error   ERROR: Command
> errored out with exit status 1:    command:
> 'C:\Users\...\Anaconda3\python.exe' -u -c 'import sys, setuptools,
> tokenize; sys.argv[0] =
> '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"';
> __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d 'C:\Users\...\AppData\Local\Temp\pip-wheel-02i01qsx'

那么经过很长的错误输出,结束就是:

 Rolling back uninstall of pandas
  Moving to c:\users\...\anaconda3\lib\site-packages\pandas-1.2.0.dist-info\
   from C:\Users\...\Anaconda3\Lib\site-packages\~andas-1.2.0.dist-info
  Moving to c:\users\...\anaconda3\lib\site-packages\pandas\
   from C:\Users\...\Anaconda3\Lib\site-packages\~-ndas
ERROR: Command errored out with exit status 1: 'C:\Users\...\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"'; __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\...\AppData\Local\Temp\pip-record-67jzzkdh\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\...\Anaconda3\Include\pandas' Check the logs for full command output.

任何提示或帮助将不胜感激。

【问题讨论】:

  • 您好,您解决了这个问题吗?我有点被这个问题困住了。
  • 我在 python 3.8 中遇到了这个问题,我找不到解决方案。但是,它安装在 python 3.7 中非常困难。

标签: python python-3.x pandas windows google-colaboratory


【解决方案1】:

来自Colab's issues repo,Craig Citro(Google Colab 的软件工程师)陈述如下

无法在本地运行 colab 前端。

但请注意,Colaboratory 允许您使用 Jupyter 连接到本地运行时。这允许您在本地硬件上执行代码并访问本地文件系统(它是具有本地运行时的 Colab 前端)。如果那是您的目标,here 您可以找到实现目标的方法。

设置说明

为了允许 Colaboratory 连接到本地运行的 Jupyter 服务器,您需要执行以下步骤。

第 1 步: 安装 Jupyter 在本地计算机上安装 Jupyter。

第 2 步:安装并启用 jupyter_http_over_ws jupyter 扩展(一次性) jupyter_http_over_ws 扩展由 Colaboratory 团队编写,可在 GitHub 上找到。

pip install jupyter_http_over_ws
jupyter serverextension enable --py jupyter_http_over_ws

第 3 步:启动服务器并进行身份验证

新笔记本服务器正常启动,但您需要设置一个标志以明确信任来自 Colaboratory 前端的 WebSocket 连接。

jupyter notebook \
  --NotebookApp.allow_origin='https://colab.research.google.com' \
  --port=8888 \
  --NotebookApp.port_retries=0

一旦服务器启动,它将打印一条消息,其中包含初始 用于身份验证的后端 URL。按照您的要求制作此 URL 的副本 需要在下一步中提供。第四步:连接本地 运行时

在 Colaboratory 中,单击“连接”按钮并选择“连接到 local runtime..."。在对话框中输入上一步中的 URL 出现并单击“连接”按钮。在此之后,您应该 现在连接到您的本地运行时。

【讨论】:

    猜你喜欢
    • 2019-06-04
    • 2021-05-30
    • 2019-08-28
    • 2021-06-23
    • 2019-01-02
    • 2021-11-18
    • 2020-06-09
    • 1970-01-01
    • 2019-02-28
    相关资源
    最近更新 更多