Project error Guess the flag!

Hello,

not sure if that’s the right place for this but im facing an error, where im not sure if this is my fault or a system error.

I just startet the Project:
MACHINE LEARNING I
Find the flag!

and by simply pressing the first time play, im getting this error down below.
So i can’t even do the first task.

Any suggestions?

Thanks in advance.

"/usr/lib/python3.6/urllib/request.py", line 1368, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.6/urllib/request.py", line 1327, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>

Can you please include a link to the lesson and the exact spot?

You’re getting this error in the CC learning environment or on your machine?

Did you happen to look up the error message?
I wonder if this will help:

1 Like

I’m wondering if it would be resolved if you updated to the latest version of python (3.12)? What OS are you using?

And:

1 Like

2 important questions:

  • are you on a mac or linux?
  • what are you requesting (in terms of the HTTP request)

Depending on your priorities, it may be worth tackling one but not the other.

So if you’re doing some machine learning module, I might assume that the HTTP request via urllib is for data. There are other ways of getting data though that are not through urllib (for example, you can use Postman to give the same request to that website, or manually make the request if it’s simple enough via your browser). Then save the data and make it accessible to your python context. And even then, if you feel like you don’t want to deal with that, there’s other intro modules (for example, on kaggle), where you don’t need to go about it this way.

That being said, you may often need to do technical setup troubleshooting. So it’s never a bad idea to tackle the setup problem directly. If you are in fact on mac, the stackoverflow post linked by @lisalisaj might have useful tips. In particular, you want to search about setting up SSL certificates on your specific mac operating system (whatever yours might be called, snow leopard, capitan, i never keep track of these… i just checked and I’m on sonoma, would’ve never guessed).

There is the “hack” workaround of telling urllib to ignore the SSL certificate but that’s a slippery slope and I would not recommend it for security purposes. (The thinking is: if it’s something you might do more than once, you gotta get it set up anyway, why ever expose yourself more than you need to out of not wanting to deal with setup… setup is after all a part of the dance).

2 Likes

Thanks for all your reply.

unfortunatly, its not on my machine, its directly in the browser.
without witting any line of code (except what’s already there) the error occurs as soon i press run:

Link:
https://www.codecademy.com/journeys/data-scientist-ml/paths/dsmlcj-22-machine-learning-i/tracks/dsmlcj-22-supervised-learning-i/modules/mle-decision-trees-8b27e5b3-0352-4887-a8e5-e4a507597ad5-fc6f7fa3-d862-4a3c-9a50-e939437fdd97/projects/mlfun-decision-trees-project

Congratulations! You found a bug (I think). :slight_smile: I got the same error message. But, I wonder if it occurs b/c there’s no real code in place and it just says, “None”.
If you go thru the steps and plug in the code for each step, the message is still there…

Edit: I got up to step 5 and the error message disappears. Try it out and see if it’s the same for you.