-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Chapter 2 - Download the Data #178
Comments
Same issue here, running on my Jetson nano. When I run this code i get a urllib request error. Importing urlib.request fixed that; however, even after calling the function I don't get a directory made and am currently investigating the path as that doesn't work either. |
did you call the function? (which is in the next cell) |
fetch_housing_data() called... Error output |
from __future__ import division, print_function, unicode_literals
import numpy as np
import os
import pandas as pd
import tarfile
from six.moves import urllib
DOWNLOAD_ROOT = "https://raw.githubusercontent.com/ageron/handson-ml/master/"
HOUSING_PATH = os.path.join("datasets", "housing")
HOUSING_URL = DOWNLOAD_ROOT + "datasets/housing/housing.tgz"
def fetch_housing_data(housing_url=HOUSING_URL, housing_path=HOUSING_PATH):
if not os.path.isdir(housing_path):
os.makedirs(housing_path)
tgz_path = os.path.join(housing_path, "housing.tgz")
urllib.request.urlretrieve(housing_url, tgz_path)
housing_tgz = tarfile.open(tgz_path)
housing_tgz.extractall(path=housing_path)
housing_tgz.close() |
I didn't. But now, it gave me this error: URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)> |
Hello community, just started with this interesting book, but a problem came over with this following code: %matplotlib inline Once I deployed, it shows the following error: AttributeError Traceback (most recent call last) /opt/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth) </opt/anaconda3/lib/python3.7/site-packages/decorator.py:decorator-gen-108> in matplotlib(self, line) /opt/anaconda3/lib/python3.7/site-packages/IPython/core/magic.py in (f, *a, **k) /opt/anaconda3/lib/python3.7/site-packages/IPython/core/magics/pylab.py in matplotlib(self, line) /opt/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui) /opt/anaconda3/lib/python3.7/site-packages/IPython/core/pylabtools.py in activate_matplotlib(backend) AttributeError: module 'matplotlib' has no attribute 'interactive' Need help to solve this exercise. |
I had the same error |
Hi there, @mzeman1 , you're running into a very common problem which is linked to the installation of Python on MacOSX. You need to install the SSL certificates. I explain how in the FAQ. @Cpauls35 , getting an HTTP 404 error is weird. This means that the URL is invalid. The only explanation I can see is there's a typo in your code. Please make sure you're running exactly the same code as in the notebook. If it still doesn't work, please check your network settings, perhaps a firewall or proxy is messing things up. In any case, if you run the notebook in Colab, you will see that everything works fine. @2807754 and @zkDreamer , this StackOverflow question seems to have an accepted answer that may fix your problem: in short, uninstall matplotlib and reinstall it. Hope this helps. |
@mzeman1, I just had this same error (On macOS Monterey 12.2.1 (21D62) on an M1 MacBook Air), and the following Github answer solved the problem for me. Cadene/pretrained-models.pytorch#193 (comment) I reworked the data fetching logic for Chapter 2 into the following, which worked on my machine:
|
@AlejandorLazaro , please don't do this ! It deactivates all SSL verification, basically destroying all SSL security. It's not the right solution. Instead, please install the root certificates by opening a terminal and running the following command (change 3.10 to whatever Python version you are using):
This will install the If you installed Python using MacPorts, then run |
Whoops! Thanks for the response and correction there! |
This code doesn't work for me:
The text was updated successfully, but these errors were encountered: