简体   繁体   English

conda-build 错误:目录 '.' 不可安装。 未找到“setup.py”和“pyproject.toml”

[英]conda-build error: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found

Hej all,嘿嘿,

I am trying to build a conda package for a little program I wrote.我正在尝试为我编写的一个小程序构建一个 conda 包。 When I run conda-build , I get the error Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.当我运行conda-build ,出现错误Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found. Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

I have researched this for some hours now (found the similar questions here, none of which solved my issue) and played with the meta.yaml file (below), but I didn't manage to get it to work.我已经研究了几个小时(在这里找到了类似的问题,没有一个解决了我的问题)并使用了 meta.yaml 文件(如下),但我没有设法让它工作。 Does anyone have an idea what could be going on here?有谁知道这里会发生什么?

meta.yaml:元.yaml:

{% set name = "genview" %}
{% set version = "1.0" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  git_url: https://github.com/EbmeyerSt/GEnView.git

build: 
  number: 0
  script: python -m pip install --no-deps --ignore-installed .

requirements:
  host:
    - pip
    - python=3.6
  run:
    - python=3.6
    - pip
    - pandas
    - biopython >=1.68
    - numpy
    - time
    - sqlite
    - argparse
    - prodigal
    - diamond
    - blast
    - cd-hit
    - fasttree

test:
  commands:
          - genview_create_db.py --help

about:
  home: https://github.com/EbmeyerSt/GEnView.git
  license: GPLv3.0
  license_family: GPL3
  summary: Visualization tool for genomic sequences surrounding a gene

directory structure:目录结构:

../genview:
  -script.py
  -Readme.txt
   /conda_receipe:
     -meta.yaml

To build the package, I run conda-build /conda_receipe from the genview directory.为了构建包,我从 genview 目录运行conda-build /conda_receipe Does anyone have an idea what is going on here?有谁知道这里发生了什么? Any clues would be appreciated!任何线索将不胜感激!

According to the packaging scheme, you need a setup.py or a pyproject.toml in your project.根据打包方案,您的项目中需要一个setup.py或一个pyproject.toml They are configuration files to generate a package.它们是用于生成包的配置文件。

If you want to use a setup.py file, it is better to use setuptools :如果要使用setup.py文件,最好使用setuptools

from setuptools import setup

setup(...)  # add your setuptools options

(See the reference for setuptools usage here ). (请参阅此处的setuptools用法参考)。

However, if you want to use a pyproject.toml instead, you can refer to the build project.但是,如果您想改用pyproject.toml ,则可以参考build项目。 You will have to write the pyprojet.toml file (which is an INI-like file).您必须编写pyprojet.toml文件(这是一个类似 INI 的文件)。

See an example of using these files on this repository .请参阅在此存储库中使用这些文件的示例。 It uses both files, so take a look on it to get an idea.它使用这两个文件,所以看看它以获得一个想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 目录 '。' 不可安装。 未找到“setup.py”和“pyproject.toml” - Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found 错误:目录不可安装。 “setup.py”和“pyproject.toml”都不是 - ERROR: Directory is not installable. Neither 'setup.py' nor 'pyproject.toml' 关于 pyproject.toml 与 setup.py 的问题 - Questions on pyproject.toml vs setup.py 如何构建符合 PEP 517 的 C 扩展,即使用 pyproject.toml 而不是 setup.py? - How to build a C extension in keeping with PEP 517, i.e. with pyproject.toml instead of setup.py? setuptools pyproject.toml 相当于`python setup.py clean --all` - setuptools pyproject.toml equivalent to `python setup.py clean --all` 从 setup.py 迁移到 pyproject.toml:如何指定 package 名称? - Migration from setup.py to pyproject.toml: how to specify package name? conda-build 使用旧的(陈旧的)setup.py - conda-build using an old (stale) setup.py 如何从 setup.py 中读取来自 pyproject.toml 的项目依赖项,以避免在两个文件中重复信息? - How do I read project dependencies from pyproject.toml from my setup.py, to avoid duplicating the information in both files? 如何使 conda-build 正常工作并找到 setup.py? - How to make conda-build work correctly and find the setup.py? 如何使用 pyproject.toml 构建万能轮 - How to build a universal wheel with pyproject.toml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM