[Python-ideas] "import me" to display some summary of the current python installation
Wes Turner
wes.turner at gmail.com
Wed Apr 12 10:02:10 EDT 2017
Steven,
I had intended to answer the question. If I did not answer this question, I
must have misunderstood the question.
> Never mind. site._script() as pointed out by Wes Turner is what I need:
These commands could also be helpful for the inferred use case:
$(which pip) --version
$(which python) -m pip freeze
python -m pip freeze --user
python -m pip freeze --l
python -m pip freeze -r ./requirements.txt
conda --version
conda config --show
conda env export # .yaml
dotfiles_status() # westurner/dotfiles/develop/etc/bash/
05-bashrc.dotfiles.sh
echo $VIRTUAL_ENV
echo $CONDA_ENVS_PATH $WORKON_HOME
In terms of printing the actual versions of {Python, pkgs, }
for reproducibility,
for Jupyter Notebook, there's:
a %version_information magic command extension:
https://github.com/jrjohansson/version_information/blob/master/version_information/version_information.py
and also %watermark:
https://github.com/rasbt/watermark/blob/master/watermark/watermark.py
A way to print all this environment information from the CLI (as e.g. JSON
and/or YAML) would indeed be useful (e.g. for CI build logs / as a build
artifact).
On Tue, Apr 11, 2017 at 10:04 PM, Steven D'Aprano <steve at pearwood.info>
wrote:
> On Tue, Apr 11, 2017 at 09:28:22PM -0500, Wes Turner wrote:
>
> > python -m site
> > https://github.com/python/cpython/blob/master/Lib/site.py
> > - _script()
>
>
> Wes, I have no idea what that code snippet is supposed to do, or even
> whether it is supposed to be working code.
>
> Remember that we can't read your mind. If you're experimenting with code
> and trying things out, please don't waste the time of everyone else by
> doing it on the mailing list.
>
>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170412/a83f9b0d/attachment.html>
More information about the Python-ideas
mailing list