![](/img/trans.png)
[英]When building conda packages using conda-build and my code uses pure python libraries, what do I need to put in build/host/run in the meta.yaml file?
[英]conda-build complains incorrectly that dependency is not included in meta.yaml
我正在嘗試構建一個 Python 模塊( wsamdata
)作為wsamdata
包。 conda-build
失敗並顯示錯誤消息(完整輸出: https : //pastebin.com/sKXNEcB6 )
RuntimeError: Setuptools downloading is disabled in conda build.
Be sure to add all dependencies in the meta.yaml url=https://pypi.org/simple/click/
click
是一個依賴項,因此我將它包含在我的meta.yaml
(見下文),所以看到這條消息我有點困惑。
package:
name: wsamdata
version: 0.6.0
source:
git_rev: v0.6.0
git_url: https://github.com/kinverarity1/wsamdata
requirements:
build:
- python
- pip
- setuptools
- numpy
- pandas
- geopandas
- sqlparse
- click
- cx_Oracle
- pillow
- sqlalchemy
- python-sa-gwdata>=0.5.4
- lasio
run:
- python
- numpy
- pandas
- geopandas
- sqlparse
- click
- cx_Oracle
- pillow
- sqlalchemy
- python-sa-gwdata>=0.5.4
- lasio
顯然click
也包含在wsamdata
包的setup.py
文件中的install_requires=[...]
下:
from setuptools import setup
setup(
name="wsamdata",
version="0.6.0",
packages=["wsamdata"],
install_requires=[
"python-sa-gwdata>=0.5.4",
"pandas",
"geopandas",
"sqlparse",
"click",
"cx_Oracle",
"pillow",
"numpy",
"sqlalchemy",
"lasio",
]
)
我無法分享wsamdata
的來源,所以我知道這不是一個可重復的例子,但我被卡住了,想知道我是否遺漏了一些明顯的東西。 我已經能夠在這台機器上成功使用conda-build
為python-sa-gwdata
構建一個 conda 包。
我發現了其他類似的問題,但它們與meta.yaml
conda skeleton
設置有關,這些設置生成了缺少要求的meta.yaml
文件。 我從頭開始編寫了這個meta.yaml
。
我的.condarc
文件:
channels:
- kinverarity
- conda-forge
- defaults
ssl_verify: true
auto_update_conda: true
always_yes: true
show_channel_urls: true
create_default_packages:
- pip
- black
pip_interop_enabled: true
anaconda_upload: false
如果有人偶然發現這一點,我遇到了同樣的問題並使用解決了它
--single-version-externally-managed --record=record.txt
pip install 命令中的選項,如anaconda 雲文檔中所建議
如果您使用的是build.sh
或bld.bat
,請嘗試:
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
或者
"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt
, 分別。
或者,您可以將其添加到您的 meta.yaml 中:
build:
script: {{ PYTHON }} setup.py install --single-version-externally-managed --record=record.txt
或者,如果您使用的是conda skeleton ,對於 pypi.org 中已經存在的包:
build:
script: {{ PYTHON }} -m pip install . --single-version-externally-managed --record=record.txt --no-deps --ignore-installed --no-cache-dir -vvv
我有這個問題,以及和它根植於相互矛盾的版本信息setup.py
/ requirements.txt
文件相比meta.yaml
文件。 查看那里並確保任何版本規格都相同。 多虧了這里的 ML 帖子,我才被引導到這里:
https://groups.google.com/a/continuum.io/forum/#!msg/anaconda/dELRaivwdMg/5IWgDcdqAwAJ
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.