ageron/handson-ml3
[bug] File Save Error for 02_end_to_end_machine_learning_project.ipynb
Aperta
#213 aperta il 11 ago 2025
bughelp wanted
Metriche repository
- Star
- (13.907 stelle)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
Enter the chapter number
Chapter 2, 1.1 Download the Data
Enter the page number
No response
What is the cell's number in the notebook
4
Enter the environment you are using to run the notebook
Jupyter on Linux
Describe your issue
I did a docker install according to https://github.com/ageron/handson-ml3/tree/main/docker When opening the Jupyter notebook at http://127.0.0.1:8888/lab/tree/02_end_to_end_machine_learning_project.ipynb and successvely run the cells by hitting [Shift]+[Enter], I get an error dialog saying
File Save Error for 02_end_to_end_machine_learning_project.ipynb
Permission denied: 02_end_to_end_machine_learning_project.ipynb
when running cell [4]:
from pathlib import Path
import pandas as pd
import tarfile
import urllib.request
def load_housing_data():
tarball_path = Path("datasets/housing.tgz")
if not tarball_path.is_file():
Path("datasets").mkdir(parents=True, exist_ok=True)
url = "https://github.com/ageron/data/raw/main/housing.tgz"
urllib.request.urlretrieve(url, tarball_path)
with tarfile.open(tarball_path) as housing_tarball:
housing_tarball.extractall(path="datasets")
return pd.read_csv(Path("datasets/housing/housing.csv"))
housing = load_housing_data()
The complete error message is:
---------------------------------------------------------------------------
PermissionError Traceback (most recent call last)
Cell In[4], line 16
13 housing_tarball.extractall(path="datasets")
14 return pd.read_csv(Path("datasets/housing/housing.csv"))
---> 16 housing = load_housing_data()
Cell In[4], line 9, in load_housing_data()
7 tarball_path = Path("datasets/housing.tgz")
8 if not tarball_path.is_file():
----> 9 Path("datasets").mkdir(parents=True, exist_ok=True)
10 url = "https://github.com/ageron/data/raw/main/housing.tgz"
11 urllib.request.urlretrieve(url, tarball_path)
File /opt/conda/envs/homl3/lib/python3.10/pathlib.py:1175, in Path.mkdir(self, mode, parents, exist_ok)
1171 """
1172 Create a new directory at this given path.
1173 """
1174 try:
-> 1175 self._accessor.mkdir(self, mode)
1176 except FileNotFoundError:
1177 if not parents or self.parent == self:
PermissionError: [Errno 13] Permission denied: 'datasets'
My user is a member of the docker group.
Enter what you expected to happen
The code should run without error, and the targe directory for the download should be created.
If you found a workaround, describe it here
No response