我正在尝试研究用于 python 包/虚拟环境管理的 conda。但是,我似乎无法构建自己的 conda 包。有人可以帮我构建一个最小的工作示例吗?
首先是一些目录结构:
- src/
|- foo1.py
|- foo2.py
- conda-build/
|- meta.yaml
- setup.py
运行python setup.py install
使用 pip 安装软件包。现在,如果我尝试 cd 到 conda-build 目录并运行,conda build .
我会得到以下输出
Removing old build directory
Removing old work directory
BUILD START: example_pkg-0.5.1-abc
Fetching package metadata: ......
Solving package specifications: .
The following NEW packages will be INSTALLED:
pip: 6.1.1-py34_0
python: 3.4.3-0
setuptools: 15.0-py34_0
Linking packages ...
[ COMPLETE ]|##################################################| 100%
Removing old work directory
Copying C:\some\path\ to C:\Anaconda3\conda-bld\work
Package: example_pkg-0.5.1-abc
source tree in: C:\Anaconda3\conda-bld\work
number of files: 0
Fixing permissions
Fixing permissions
BUILD END: example_pkg-0.5.1-abc
Nothing to test for: example_pkg-0.5.1-abc
# If you want to upload this package to binstar.org later, type:
#
# $ binstar upload C:\Anaconda3\conda-bld\win-64\example_pkg-0.5.1- abc.tar.bz2
#
# To have conda build upload to binstar automatically, use
# $ conda config --set binstar_upload yes
我确实可以在目录 C:\Anaconda3\conda-bld\win-64 中找到该包,但该包似乎不包含任何文件。我可以使用安装包conda install --use-local .\example_pkg-0.5.1-abc.tar.bz2
,然后它被列出conda list
,但是我不能在 Python 中导入它。这是我的 meta.yaml:
package:
name: example_pkg
version: "0.5.1"
source:
path: ../src
build:
number: 1
string: abc
script: python setup.py install
requirements:
build:
- python
run:
- python
任何帮助是极大的赞赏!:)