Upload and manage packages that are not in conda to anaconda.org

Introduction

Packages that cannot be installed with conda are usually installed with pip, but it is possible (and should be) to build and manage packages with conda.

** This method alone is not good because it seems that the required packages are included in both pip and conda. ** ** ** If anyone knows more details, please let me know. ** **

Required packages

Build with conda and install the packages needed to upload to anaconda.org with conda.

conda install conda-build anaconda-client

Until recently, 64bit Win had a bug, so if you are using windows and already have conda-build, you should update it. Better.

conda update conda-build

conda & upload

As an example, when converting pandas_ml to conda, it looks like this. Create a build recipe with skeleton, build locally, and upload to anaconda.org if needed.

mkdir work
cd work
conda skeleton pypi pandas_ml --version 0.3.0 
cd pandas_ml
conda build . --python=3.4
# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes
conda build . --output
#>>> <anaconda root>\conda-bld\win-64\pandas_ml-0.3.0-py34_0.tar.bz2

When installing locally without using anaconda.org

onda install --use-local pandas_ml

When uploading to anaconda.org

Sign up for anaconda.org. It's free if you don't use private.

anaconda login
#>>> Using Anaconda Cloud api site https://api.anaconda.org
#>>> Username: y__sama
#>>> Password:
#>>> login successful
#>>> y__sama's
anaconda upload <anaconda root>\conda-bld\win-64\pandas_ml-0.3.0-py34_0.tar.bz2

If you often upload to anaconda, set conda config --set anaconda_upload yes.

If you are installing from anaconda.org, you can specify the channel as usual and install.

conda install -c y__sama pandas_ml

I often get errors because the dependent packages can't be installed with conda or aren't listed in the recipe (meta.yaml). If an error occurs, you need to create a separate dependent package with conda build or edit meta.yaml while looking at the message.

http://conda.pydata.org/docs/build_tutorials/pkgs.html#troubleshooting

Environment copy in local

conda create -n env_copy --clone env

Migrate to another server (via file)

If you want to upload to anaconda.org and use it, add a channel.

conda config --add channels y__sama

Export the environment to a file once and specify it with the --file option when creating.

conda list -e > env.txt
conda create -n env_file --file env.txt

But for some reason, both pip and conda are included. .. ..

conda list
#>>> ...Abbreviation
#>>> jsonschema                2.5.1                    py35_0    defaults
#>>> jupyter-client            4.2.2                     <pip>
#>>> jupyter-cms               0.5.0                     <pip>
#>>> jupyter-core              4.1.0                     <pip>
#>>> jupyter_client            4.2.2                    py35_0    defaults
#>>> jupyter_cms               0.5.0                    py35_0    y__sama
#>>> jupyter_core              4.1.0                    py35_0    defaults
#>>> libsodium                 1.0.3                         0    defaults
#>>> ...Abbreviation

Now you should be able to manage packages with just the conda list without using pip freeze and the conda list together.

If you have any details, I would appreciate it if you could comment.

reference

https://gist.github.com/aphlysia/d5fcee79ff81b8272faf http://conda.pydata.org/docs/build_tutorials/pkgs.html http://docs.anaconda.org/cli.html

Recommended Posts

Upload and manage packages that are not in conda to anaconda.org
A solution to the problem that files containing [and] are not listed in glob.glob ()
Regular expressions that are easy and solid to learn in Python
Modules and packages in Python are "namespaces"
Manage python packages to install in containers
[Jinja2] Solution to the problem that variables added in the for statement are not inherited
plotly trace and layout templates that are likely to be used in scatter plots
[Introduction to Udemy Python 3 + Application] 36. How to use In and Not
A standard way to develop and distribute packages in Python
[AWS IoT] Delete certificates that are not attached to things
Try to extract the keywords that are popular in COTOHA
Introduction to Effectiveness Verification Chapters 4 and 5 are written in Python
Pit pits that logs are not rotated in Fedora 33 (beta)
How to smartly define objects that are commonly used in View
Convert files uploaded to Cloud Storage with Cloud Functions (Python) so that they are not garbled in Excel
MIDI packages in Python midi and pretty_midi
Upload packages to PyPI using tokens
a () and a.__ call__ () are not equivalent
With PEP8 and PEP257, Python coding that is not embarrassing to show to people!
How to scrape pages that are “Access Denied” in Selenium + Headless Chrome
How to hide warnings that do not affect execution in Jupyter Notebook
Suppressed "Field may not be null." Appearing in fields that are not null and default in DB definition with connexion and marshmallow-sqlalchemy