I am trying to create an anaconda python package. My meta.yaml
looks like this:
package:
name: liveprint-lib
version: "0.1.0"
build:
number: 0
requirements:
build:
- pip
- python=3.7
- setuptools
run:
- python=3.7
- numpy
- opencv
about:
home: https://github.com/monomonedula/liveprint
license: Apache License 2.0
license_file: LICENSE.txt
summary: Python utility library for dynamic animations projections
build.sh
:
$PYTHON setup.py install
The folder structure:
.
├── bld.bat
├── build.sh
├── LICENSE.txt
├── liveprint
├── meta.yaml
├── README.md
├── resources
├── setup.py
└── test
The error I get when running conda build .
is the following:
/home/vhhl/programs/anaconda3/conda-bld/liveprint-lib_1581422598848/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/bin/python: can't open file 'setup.py': [Errno 2] No such file or directory
What am I doing wrong?
The Conda recipe is used to build a package for distribution. It builds a temporary environment with the dependencies in `recipe/meta. yaml`, then runs `python setup.py install` to install the package into that environment.
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
The setup.py file is a Python file which indicates that the installation module/package is most likely packed and distributed using Distutils, the Python Module distribution standard.
Your meta.yaml
file is missing a source
section. Also, it's usually best to keep your recipe files in a directory of their own, rather than in the top repo. I recommend the following:
mkdir conda-recipe
mv meta.yaml build.sh bld.bat conda-recipe
Then, edit meta.yaml
to add a source
section, which points to the top-level directory of your repo.
package:
name: liveprint-lib
version: "0.1.0"
source:
# Relative path to the parent directory.
path: ..
build:
number: 0
requirements:
build:
- pip
- python=3.7
- setuptools
run:
- python=3.7
- numpy
- opencv
Then try:
conda build conda-recipe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With