is there an easy way to print the license of each package in a conda environment?
conda list nicely lists all packages, however there is no option to get information about the license. On Anaconda the license is shown.
I tried to find the licenses in each package folder, but was not lucky. Is the only option to look at each package individually on Anaconda.org?
Conda version 4.6.14
Thanks
in terminal, type : conda list to obtain the packages installed using conda.
Use pip installed with conda , e.g. ~/anaconda/bin/pip . Use it to install packages into a conda environment, as well as to see the union of packages installed with this pip and with conda install .
To search for a specific package, use: conda search -f <package_name> . For example, based on the question, to search all versions for "jupyter" package, you'll do: conda search -f jupyter . This will only return information about packages named "jupyter" exactly.
To list any variables you may have, run conda env config vars list . To set environment variables, run conda env config vars set my_var=value . Once you have set an environment variable, you have to reactivate your environment: conda activate test-env .
You can find it in the JSON files under the conda-meta folder in each env. The key license is in the main object, if you're looking to parse the JSON. Otherwise, you can get a quick look with:
grep '"license":' conda-meta/*.json
which outputs the following (abridged) for me:
conda-meta/aioeasywebdav-2.4.0-py37_1000.json: "license": "ISC",
conda-meta/aiohttp-3.5.4-py37h1de35cc_0.json: "license": "Apache 2.0",
conda-meta/appdirs-1.4.3-py37h28b3542_0.json: "license": "MIT",
conda-meta/appnope-0.1.0-py37_0.json: "license": "BSD 2-Clause",
conda-meta/asn1crypto-0.24.0-py37_0.json: "license": "MIT",
...
conda-meta/xz-5.2.4-h1de35cc_4.json: "license": "LGPL-2.1 and GPL-2.0",
conda-meta/yaml-0.1.7-hc338f04_2.json: "license": "MIT",
conda-meta/yarl-1.3.0-py37h1de35cc_0.json: "license": "Apache 2.0",
conda-meta/zeromq-4.2.5-h0a44026_1.json: "license": "LGPL 3",
conda-meta/zlib-1.2.11-h1de35cc_3.json: "license": "zlib",
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