我用旧笔记本做
!pip freeze > 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.
Kaggle:如何导出带有现有下载文件的旧环境?如何导入到新的 Kaggle 笔记本?
错误来自 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'].
您可以通过分叉存储库、在
py_modules=['bq_helper', 'test_helper', 'version'],
下面添加行 license='Apache 2.0',
并使用 kaggle_environment.txt 中的分叉链接来解决此问题