Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install into a Python container's virtualenv #192

Open
iaindillingham opened this issue Feb 13, 2023 · 0 comments
Open

pip install into a Python container's virtualenv #192

iaindillingham opened this issue Feb 13, 2023 · 0 comments

Comments

@iaindillingham
Copy link
Member

I'd like to be able to pip install into a Python container's virtualenv. Doing so would allow me to use profiling tools from within IPython, as described in Profiling and Timing Code in the Python Data Science Handbook.

If I run

docker run --interactive --tty --volume $(pwd):/workspace --entrypoint ipython ghcr.io/opensafely-core/python:latest

then I can

!pip install memory_profiler

from within IPython. However, if I run

opensafely exec python:latest ipython

then pip install fails, because it doesn't have permission to write to /opt/venv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant