Can't install additional python packages inside an ESD environment
Since the update to Spack v0.23, it is not possible to use pip to install additional packages inside an ESD Spack env. In the experimental kernel:
!pip install boto3
Collecting boto3
Downloading boto3-1.38.9-py3-none-any.whl (139 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.9/139.9 kB 5.0 MB/s eta 0:00:00
Collecting botocore<1.39.0,>=1.38.9 (from boto3)
Downloading botocore-1.38.9-py3-none-any.whl (13.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.5/13.5 MB 29.7 MB/s eta 0:00:0000:0100:01
Collecting jmespath<2.0.0,>=0.7.1 (from boto3)
Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting s3transfer<0.13.0,>=0.12.0 (from boto3)
Downloading s3transfer-0.12.0-py3-none-any.whl (84 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.8/84.8 kB 12.3 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/view/lib/python3.11/site-packages (from botocore<1.39.0,>=1.38.9->boto3) (2.8.2)
Requirement already satisfied: urllib3!=2.2.0,<3,>=1.25.4 in /srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/view/lib/python3.11/site-packages (from botocore<1.39.0,>=1.38.9->boto3) (2.1.0)
Requirement already satisfied: six>=1.5 in /srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/view/lib/python3.11/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.39.0,>=1.38.9->boto3) (1.16.0)
Installing collected packages: jmespath, botocore, s3transfer, boto3
ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/._view/aat3owxuzk5fbmjizyam3iyf4f6majkv/lib/python3.11/site-packages/jmespath'
[notice] A new release of pip is available: 23.1.2 -> 25.1.1
[notice] To update, run: python3 -m pip install --upgrade pip
This was introduced by Spack creating a venv for each view, for which include-system-site-packages
is by default set to false
(here)
With include-system-site-packages
set to true
, packages can be installed normally (to ~/.local/lib/python3.11/site-packages
):
!pip install boto3
Defaulting to user installation because normal site-packages is not writeable
Collecting boto3
Using cached boto3-1.38.9-py3-none-any.whl (139 kB)
Collecting botocore<1.39.0,>=1.38.9 (from boto3)
Using cached botocore-1.38.9-py3-none-any.whl (13.5 MB)
Collecting jmespath<2.0.0,>=0.7.1 (from boto3)
Using cached jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting s3transfer<0.13.0,>=0.12.0 (from boto3)
Using cached s3transfer-0.12.0-py3-none-any.whl (84 kB)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/view/lib/python3.11/site-packages (from botocore<1.39.0,>=1.38.9->boto3) (2.8.2)
Requirement already satisfied: urllib3!=2.2.0,<3,>=1.25.4 in /srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/view/lib/python3.11/site-packages (from botocore<1.39.0,>=1.38.9->boto3) (2.1.0)
Requirement already satisfied: six>=1.5 in /srv/test-build-2502/ebrains-spack-builds/vendor/spack/var/spack/environments/test/.spack-env/view/lib/python3.11/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.39.0,>=1.38.9->boto3) (1.16.0)
Installing collected packages: jmespath, botocore, s3transfer, boto3
Successfully installed boto3-1.38.9 botocore-1.38.9 jmespath-1.0.1 s3transfer-0.12.0
[notice] A new release of pip is available: 23.1.2 -> 25.1.1
[notice] To update, run: python3 -m pip install --upgrade pip
Edited by Eleni Mathioulaki