首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Conda entry_points配置

Conda entry_points配置
EN

Stack Overflow用户
提问于 2016-07-13 14:28:43
回答 1查看 1.4K关注 0票数 4

我正试图从我的源代码中创建一个conda包,但是meta.yaml配置文件中的meta.yaml部分被卡住了。

解释:

下面是我的setup.py文件,它正确地与pip一起工作:

代码语言:javascript
复制
from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    long_description = f.read()

with open('requirements.txt') as f:
    required = f.read().splitlines()

setup(
    name='myproject',
    version='1.1.0',
    description='My project',
    long_description=long_description,
    url='',
    author='Me',
    author_email='me@me.com',
    license='',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Programming Language :: Python :: 3.4',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        #todo License::
        'Environment :: Console',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 3.4',
        'Topic :: Database :: Front-Ends',
        'Topic :: Adaptive Technologies',
        'Topic :: Scientific/Engineering :: Bio-Informatics',
        'Topic :: Software Development',
    ],
    keywords='workflow manager python object-oriented reproducible science database framework',
    packages=find_packages(exclude=['log', 'doc', '*.test.*', 'soutenance', 'rapport']),
    install_requires=required,
    package_data={},
    data_files=[],
    entry_points={
        'console_scripts':['wopmars=src.main.fr.tagc.wopmars.wopmars:main']
    }
)

这是我在conda食谱中的meta.yaml文件。

代码语言:javascript
复制
package:
  name: wopmars
  version: "1.1.0"

build:
  entry_points:
    - wopmars = src.main.fr.tagc.wopmars.wopmars:main

requirements:
  build:
    - python
    - setuptools

  run:
    - python

文件build.sh也存在,并包含$PYTHON setup.py install

然后我构建了conda包:

代码语言:javascript
复制
(test_wop) luc@everest:~/Documents/WORK/wopmars$ conda build .
Removing old build environment
BUILD START: wopmars-1.1.0-py35_0
Fetching package metadata .........
Solving package specifications: ..........

The following NEW packages will be INSTALLED:

    openssl:    1.0.2h-1     
    pip:        8.1.2-py35_0 
    python:     3.5.2-0      
    readline:   6.2-2        
    setuptools: 23.0.0-py35_0
    sqlite:     3.13.0-0     
    tk:         8.5.18-0     
    wheel:      0.29.0-py35_0
    xz:         5.2.2-0      
    zlib:       1.2.8-3      

Linking packages ...
[      COMPLETE      ]|#######################################################################################################################################################################################| 100%
Package: wopmars-1.1.0-py35_0
source tree in: /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1
+ source activate /home/luc/bin/anaconda3/envs/_build
++ [[ -n 4.3.42(1)-release ]]
++ _SCRIPT_LOCATION=/home/luc/bin/anaconda3/envs/_build/bin/activate
++ SHELL=bash
+++ dirname /home/luc/bin/anaconda3/envs/_build/bin/activate
++ _CONDA_DIR=/home/luc/bin/anaconda3/envs/_build/bin
++ '[' 1 -gt 1 ']'
++ case "$(uname -s)" in
+++ uname -s
++ EXT=
++ [[ -n 4.3.42(1)-release ]]
+++ basename /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1/conda_build.sh
++ [[ conda_build.sh == \a\c\t\i\v\a\t\e ]]
++ '[' 1 -eq 0 ']'
++ args=/home/luc/bin/anaconda3/envs/_build
++ /home/luc/bin/anaconda3/envs/_build/bin/conda ..checkenv bash /home/luc/bin/anaconda3/envs/_build
++ ((  0 != 0  ))
++ source /home/luc/bin/anaconda3/envs/_build/bin/deactivate
+++ [[ -n 4.3.42(1)-release ]]
+++ _SCRIPT_LOCATION=/home/luc/bin/anaconda3/envs/_build/bin/deactivate
+++ SHELL=bash
++++ dirname /home/luc/bin/anaconda3/envs/_build/bin/deactivate
+++ _CONDA_DIR=/home/luc/bin/anaconda3/envs/_build/bin
+++ case "$(uname -s)" in
++++ uname -s
+++ EXT=
+++ [[ 1 > 0 ]]
+++ key=/home/luc/bin/anaconda3/envs/_build
+++ case $key in
+++ shift
+++ [[ 0 > 0 ]]
+++ [[ -n 4.3.42(1)-release ]]
++++ basename /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1/conda_build.sh
+++ [[ conda_build.sh == \d\e\a\c\t\i\v\a\t\e ]]
+++ [[ -z '' ]]
+++ [[ -n 4.3.42(1)-release ]]
++++ basename /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1/conda_build.sh
+++ [[ conda_build.sh == \d\e\a\c\t\i\v\a\t\e ]]
+++ return 0
+++ /home/luc/bin/anaconda3/envs/_build/bin/conda ..activate bash /home/luc/bin/anaconda3/envs/_build
++ _NEW_PART=/home/luc/bin/anaconda3/envs/_build/bin
++ ((  0 == 0  ))
++ export CONDA_PATH_BACKUP=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ CONDA_PATH_BACKUP=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ export CONDA_PS1_BACKUP=
++ CONDA_PS1_BACKUP=
++ export PATH=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ PATH=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ [[ '' == */* ]]
++ export CONDA_DEFAULT_ENV=/home/luc/bin/anaconda3/envs/_build
++ CONDA_DEFAULT_ENV=/home/luc/bin/anaconda3/envs/_build
++ firstpath=/home/luc/bin/anaconda3/envs/_build/bin
+++ echo /home/luc/bin/anaconda3/envs/_build/bin
+++ sed 's|/bin$||'
++ export CONDA_PREFIX=/home/luc/bin/anaconda3/envs/_build
+++ /home/luc/bin/anaconda3/envs/_build/bin/conda ..changeps1
++ '[' 1 = 1 ']'
+++ grep -q CONDA_DEFAULT_ENV
++ export 'PS1=(/home/luc/bin/anaconda3/envs/_build) '
++ PS1='(/home/luc/bin/anaconda3/envs/_build) '
++ _CONDA_D=/home/luc/bin/anaconda3/envs/_build/etc/conda/activate.d
++ [[ -d /home/luc/bin/anaconda3/envs/_build/etc/conda/activate.d ]]
++ unset CONDA_PATH
++ [[ -n 4.3.42(1)-release ]]
++ hash -r
+ /home/luc/bin/anaconda3/envs/_build/bin/python setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to pyinstrument.egg-info/dependency_links.txt
writing pyinstrument.egg-info/PKG-INFO
writing top-level names to pyinstrument.egg-info/top_level.txt
writing entry points to pyinstrument.egg-info/entry_points.txt
reading manifest file 'pyinstrument.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyinstrument.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pyinstrument
copying build/lib/pyinstrument/profiler.py -> build/bdist.linux-x86_64/egg/pyinstrument
creating build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/resources/profile.js -> build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/resources/jquery-1.11.0.min.js -> build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/resources/style.css -> build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/__init__.py -> build/bdist.linux-x86_64/egg/pyinstrument
copying build/lib/pyinstrument/__main__.py -> build/bdist.linux-x86_64/egg/pyinstrument
copying build/lib/pyinstrument/middleware.py -> build/bdist.linux-x86_64/egg/pyinstrument
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/profiler.py to profiler.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/__main__.py to __main__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/middleware.py to middleware.cpython-35.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/pyinstrument-0.13.1-py3.5.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pyinstrument-0.13.1-py3.5.egg
creating /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages/pyinstrument-0.13.1-py3.5.egg
Extracting pyinstrument-0.13.1-py3.5.egg to /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages
Adding pyinstrument 0.13.1 to easy-install.pth file
Installing pyinstrument script to /home/luc/bin/anaconda3/envs/_build/bin

Installed /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages/pyinstrument-0.13.1-py3.5.egg
Processing dependencies for pyinstrument==0.13.1
Finished processing dependencies for pyinstrument==0.13.1
found egg dir: /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages/pyinstrument-0.13.1-py3.5.egg
number of files: 19
Fixing permissions
Detected hard-coded path in text file bin/pyinstrument
Detected hard-coded path in text file bin/wopmars
Fixing permissions
BUILD END: wopmars-1.1.0-py35_0
Nothing to test for: wopmars-1.1.0-py35_0
# If you want to upload this package to anaconda.org later, type:
#
# $ anaconda upload /home/luc/bin/anaconda3/conda-bld/linux-64/wopmars-1.1.0-py35_0.tar.bz2
#
# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes

现在开始这个问题:我不明白为什么这会输出那么多关于pyinstrument包的信息,而很少输出关于我的包wopmars ( pyinstrument包在conda教程中使用过)。

但是我一直在努力安装wopmars

代码语言:javascript
复制
(test_wop) luc@everest:~/Documents/WORK/wopmars$ conda install --use-local wopmars
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /home/luc/bin/anaconda3/envs/test_wop:

The following NEW packages will be INSTALLED:

    wopmars: 1.1.0-py35_0 local

Proceed ([y]/n)? 

Linking packages ...
[      COMPLETE      ]|#######################################################################################################################################################################################| 100%

海事组织似乎一切正常,但:

代码语言:javascript
复制
(test_wop) luc@everest:~/Documents/WORK/wopmars$ wopmars
bash: /home/luc/bin/anaconda3/envs/test_wop/bin/wopmars: Aucun fichier ou dossier de ce type

(找不到这种类型的文件或目录)

我可能漏掉了什么东西,但我不知道这里出了什么问题。

请注意,如何在entry_points包中指定项目的conda

EN

回答 1

Stack Overflow用户

发布于 2016-07-20 14:27:35

Conda正在打包pyinstruments,而不是您的项目wopmars,如构建日志中所示(从源树开始的行):

代码语言:javascript
复制
(...)
Package: wopmars-1.1.0-py35_0
source tree in: /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1
+ source activate /home/luc/bin/anaconda3/envs/_build
(...)

meta.yaml中尝试添加一个源区。假设您的meta.yaml与您的Python源文件位于同一个目录中,您可以使用:

代码语言:javascript
复制
source:
    path: .
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38354517

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档