LunchBytes

Python Virtual Environment Showdown

15th Sep 2021

University of Sheffield RSE Team

Today

3 x ~10min talks followed by Q&A

Speakers:

  • Matt Williams, Univeristy of Bristol - venv
  • Simon Li, Univeristy of Dundee - conda
  • James Graham, Software Sustainability Institute - poetry

Q&A

Questions via: https://app.sli.do/event/hcmaidrc

We’ll revisit questions after all of the talks.

import glob
import numpy
import matplotlib.pyplot

filenames = sorted(glob.glob('inflammation*.csv'))
filenames = filenames[0:3]
for filename in filenames:
    print(filename)

    data = numpy.loadtxt(fname=filename, delimiter=',')

    fig = matplotlib.pyplot.figure(figsize=(10.0, 3.0))

    axes1 = fig.add_subplot(1, 3, 1)
    axes2 = fig.add_subplot(1, 3, 2)
    axes3 = fig.add_subplot(1, 3, 3)

    axes1.set_ylabel('average')
    axes1.plot(numpy.mean(data, axis=0))

    axes2.set_ylabel('max')
    axes2.plot(numpy.max(data, axis=0))

    axes3.set_ylabel('min')
    axes3.plot(numpy.min(data, axis=0))

    fig.tight_layout()
    matplotlib.pyplot.show()

Where do packages go?

$ pip install numpy
$ pip list -v
...
numpy    1.13.3       /usr/lib/python3/dist-packages
...

Where does python look for packages?

import sys
for path in sys.path:
    print(path)
/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/home/username/.local/lib/python3.7/site-packages
/usr/local/lib/python3.7/dist-packages
/usr/lib/python3/dist-packages

What’s the issue?

  • Required package versions may conflict between projects
  • Dependency management
  • Python version management
  • Reproducibility & reliability

Talks

Q&A

Future Events

  • SeptembRSE!
    • Online research software engineering conference
    • Registration open throughout
    • Talks, discussions, panels, demos until 30th Sep
    • https://septembrse.society-rse.org/
    • Only £15 for members of the Society of Research Software Engineering

Future Events

Future Events

Getting involved with LunchBytes

We’re looking for:

  • Session curators,
  • Speakers,
  • Theme suggestions

Details at: rse.shef.ac.uk/community/lunch-bytes/

Or email:

Thank you!