在Google Colab中安装Python软件包

发布于 2025-01-22 15:00:13 字数 182 浏览 2 评论 0原文

我想在Google Colab中安装一个软件包。我尝试将setup.py上传到我的驱动器,但没有运气。

可以找到该软件包在这里

I wanted to install a package in Google Colab. I tried uploading the setup.py to my drive but with no luck.

The package can be found here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

当爱已成负担 2025-01-29 15:00:13

只需移动设置即可周围,它根本没有帮助您,它只包含设置软件包的说明。

对于该特定软件包(SDPA-P),我否则建议您尝试!PIP install您可以通过 https://sourceforge.net/projects/projects/sdpa/sdpa/files/sdpa-pa-pa-pa-p/sdpa-p/sdpap-0.2.1.1.1.tar 。

# pip install sdpap-0.2.1.tar.gz
Processing ./sdpap-0.2.1.tar.gz
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-3nmuqm1l/setup.py", line 8, in <module>
          [line.split('=') for line in open(SDPA_MAKEINC).readlines()])
      FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/sdpa/sdpa.7.3.1/etc/make.inc'
      [end of output]

​最好的选择可能是从中构建一个二进制轮套,然后将其安装在Colab中……但是,这将是相当多的工作。

Just moving setup.py around doesn't help you at all, it just contains instructions on setting up the package.

For that particular package (SDPA-P), I would otherwise advise to try to !pip install the tarball you can download via https://sourceforge.net/projects/sdpa/files/sdpa-p/sdpap-0.2.1.tar.gz/download but it seems it relies on hard-coded paths:

# pip install sdpap-0.2.1.tar.gz
Processing ./sdpap-0.2.1.tar.gz
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-3nmuqm1l/setup.py", line 8, in <module>
          [line.split('=') for line in open(SDPA_MAKEINC).readlines()])
      FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/sdpa/sdpa.7.3.1/etc/make.inc'
      [end of output]

Installing that particular package will likely require quite some work; your best bet could be to build a binary wheel package out of it, and install that in Colab... but again, it'll be quite some work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文