[PYTHON] Notes on package management with conda

Package management with conda

Basically, I decided to manage the package with conda by referring to the following.

Creating a python environment with conda

Basically, follow the above, and if you can't find the package by conda install, Create a recipe for build as shown below, build locally, and from there Once installed, all packages seemed to be manageable under conda.

shell


$ conda skeleton pypi <package name>
$ conda build <package name>
$ conda install --use-local <package name>

However, some packages do not build well, etc. It was a good thing that it didn't go smoothly.

I can't install basemap

When I tried to put the basemap package which is a toolkit of matplotlib, The recipe making (conda skeleton pypi basemap) goes well, but At build time, I was angry that there was no numpy.

shell


ImportError: No module named numpy

Of course numpy is included. After a lot of research, I found the following that was in the same situation.

conda build - ImportError: No module named numpy

According to this, it was written that the meta.yaml file should be edited, so Under the directory where conda skeleton pypi basemap was executed Below the meta.yaml file under the basemap directory

meta.yaml


requirements:
  build:
    - python
  run:
    - python

The part that was

meta.yaml


requirements:
  build:
    - python
    - numpy
  run:
    - python
    - numpy
    - matplotlib

After fixing it, I was able to build and install it safely. (* I wrote matplotlib in run only with numpy, but I passed the build, After that, it failed during the test without matplotlib)

I didn't have much information in Japanese, so I made a note for the time being.

--------- 20161204 postscript ---------

One day

shell


$ conda skeleton pypi <package name>

I got an error.

[conda skeleton pypi throws xmlrpc.client.Fault] (https://github.com/conda/conda-build/issues/1207)

It was similar to the error in, and looked like a bug in conda-build. It was a bug that had already been fixed, so

shell


$ conda install -n root conda-build

After updating condo-build to the latest version, it was solved safely.

Recommended Posts

Notes on package management with conda
About package management with conda and pip
Anaconda Package Management Notes
Notes on using rstrip with python.
Notes on running M5Stick V with uPyLoader
Python installation and package management with pip
Notes on doing Japanese OCR with Python
Notes about with
Notes on Flask
Enable Jupyter Notebook with conda on remote server
Python conda on cygwin
Notes on neural networks
Notes on HDR and RAW image processing with Python
Python package development notes
Celery notes on Django
Notes on installing PycURL
Python ipaddress package notes
Routine management with calendar
Autoencoder with Chainer (Notes on how to use + trainer)
Notes on creating a virtual environment with Anaconda Navigator
Notes on using Alembic
Notes on SciPy.linalg functions
Notes on importing data from MySQL or CSV with Python
Notes on handling large amounts of data with python + pandas
Intuitive password management with aws ssm on Mac / Linux alias
Notes on deploying pyenv with Homebrew and managing Python versions
Notes on installing dlib on mac
Notes on python's sqlite3 module
Python package management in IntelliJ
Notes on * args and ** kargs
Notes playing with symbolic links
YouTube video management with Python 3
Auto Encodder notes with Keras
Specify version with conda install
Notes on defining PySide slots (2)
[Django] Notes on using django-debug-toolbar
Notes on pyenv and Atom
Notes on defining PySide slots
[Python] Notes on data analysis
[GUI with Python] PyQt5-Layout management-
Notes on optimization using Pytorch
Notes on installing Python on Mac
Notes on studying multidimensional scaling
Linux main package management system
Notes on installing pipenv on Mac
Password management with python: keyring
Notes on installing Anaconda 3 on Windows
Notes on imshow () in OpenCV
Server management with Jupyter (1) import
Notes on installing Python on CentOS
Blogging with Pelican on Windows
(Note) Notes on building TensorFlow + Flask + Nginx environment with Docker Compose