File tree 1 file changed +15
-1
lines changed 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -921,8 +921,22 @@ if mode == "install":
921
921
quit ("Can't install into existing venv '%s'" % firedrake_env )
922
922
923
923
log .info ("Creating firedrake venv in '%s'." % firedrake_env )
924
+ # Debian's Python3 is screwed, they don't ship ensurepip as part
925
+ # of the base python package, so the default python -m venv
926
+ # doesn't work. Moreover, they have spiked the file such that it
927
+ # calls sys.exit, which will kill any attempts to create a venv
928
+ # with pip.
929
+ try :
930
+ import ensurepip
931
+ with_pip = True
932
+ except ImportError :
933
+ with_pip = False
924
934
import venv
925
- venv .EnvBuilder (with_pip = True ).create (firedrake_env )
935
+ venv .EnvBuilder (with_pip = with_pip ).create (firedrake_env )
936
+ if not with_pip :
937
+ import urllib .request
938
+ urllib .request .urlretrieve ("https://bootstrap.pypa.io/get-pip.py" , filename = "get-pip.py" )
939
+ check_call (python + ["get-pip.py" ])
926
940
# Ensure pip and setuptools are at the latest version.
927
941
run_pip (["install" , "-U" , "setuptools" ])
928
942
run_pip (["install" , "-U" , "pip" ])
You can’t perform that action at this time.
0 commit comments