我正在尝试构建一个Python模块(wsamdata
)作为conda软件包。 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
也包含在install_requires=[...]
程序包的wsamdata
文件的setup.py
下:
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程序包。
我发现了其他类似的问题,但是它们与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
答案 0 :(得分:0)
我也遇到了这个问题,它的根源是与setup.py
文件相比,requirements.txt
/ meta.yaml
文件中的版本信息冲突。看那里,确保所有版本规格都相同。多亏了这里的ML帖子,我才得以实现这一目标:
https://groups.google.com/a/continuum.io/forum/#!msg/anaconda/dELRaivwdMg/5IWgDcdqAwAJ
答案 1 :(得分:0)
万一有人偶然发现,我遇到了同样的问题,并使用
解决了 --single-version-externally-managed --record=record.txt
选项
如果您使用的是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
,或者,如果您使用的是anaconda cloud documentation,则对于pypi.org中已经存在的软件包:
build:
script: {{ PYTHON }} -m pip install . --single-version-externally-managed --record=record.txt --no-deps --ignore-installed --no-cache-dir -vvv