Kaggle:如何使用现有下载文件导出旧环境?

问题描述 投票:0回答:1

我用旧笔记本做

!pip freeze > kaggle_environment.txt

结果https://gist.githubusercontent.com/donhuvy/eecbaed4da2c04f42ae6960eff897e38/raw/a920cdf67f8c3e139e226ee4cdc7f1c498734a2e/kaggle_environment.txt

我创建了一个新的 Kaggle 笔记本,并且有代码块

!pip install -r https://gist.githubusercontent.com/donhuvy/eecbaed4da2c04f42ae6960eff897e38/raw/a920cdf67f8c3e139e226ee4cdc7f1c498734a2e/kaggle_environment.txt

错误

Obtaining bq_helper from git+https://github.com/SohierDane/BigQuery_Helper@8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f#egg=bq_helper (from -r https://gist.githubusercontent.com/donhuvy/eecbaed4da2c04f42ae6960eff897e38/raw/a920cdf67f8c3e139e226ee4cdc7f1c498734a2e/kaggle_environment.txt (line 46))
  Cloning https://github.com/SohierDane/BigQuery_Helper (to revision 8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f) to ./src/bq-helper
  Running command git clone --filter=blob:none --quiet https://github.com/SohierDane/BigQuery_Helper /kaggle/working/src/bq-helper
  Running command git rev-parse -q --verify 'sha^8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f'
  Running command git fetch -q https://github.com/SohierDane/BigQuery_Helper 8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f
  Resolved https://github.com/SohierDane/BigQuery_Helper to commit 8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      error: Multiple top-level modules discovered in a flat-layout: ['test_helper', 'version', 'bq_helper'].
      
      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.
      
      If you are trying to create a single distribution with multiple modules
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:
      
      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names
      
      To find more information, look for "package discovery" on setuptools docs.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

enter image description here

Kaggle:如何导出带有现有下载文件的旧环境?如何导入到新的 Kaggle 笔记本?

python kaggle
1个回答
0
投票

错误来自 txt 文件中的第

-e git+https://github.com/SohierDane/BigQuery_Helper@8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f#egg=bq_helper
行,

它明确指出:

error: Multiple top-level modules discovered in a flat-layout: ['test_helper', 'version', 'bq_helper'].

可以通过
处的文件结构进行验证 https://github.com/SohierDane/BigQuery_Helper/tree/master 所有三个 py 文件位于同一层次结构,导致自动发现失败 因此,这只是软件包分发开发人员的错误

您可以通过分叉存储库、在

py_modules=['bq_helper', 'test_helper', 'version'],
下面添加行
license='Apache 2.0',
并使用 kaggle_environment.txt 中的分叉链接来解决此问题

© www.soinside.com 2019 - 2024. All rights reserved.