---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/packages/urllib3/util/ssl_.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir)
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
422 if isinstance(timeout, tuple):
--> 423 try:
424 connect, read = timeout
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/packages/urllib3/connectionpool.py in _validate_conn(self, conn)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/packages/urllib3/connection.py in connect(self)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/packages/urllib3/util/ssl_.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir)
SSLError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
<ipython-input-85-2f7865374943> in <module>
2
3
----> 4 myfitnesspal.Client(username = '')
5
6
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in __init__(self, username, password, login, unit_aware)
56 self.session = requests.Session()
57 if login:
---> 58 self._login()
59
60 @property
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in _login(self)
84 def _login(self):
85 login_url = parse.urljoin(self.BASE_URL_SECURE, self.LOGIN_PATH)
---> 86 document = self._get_document_for_url(login_url)
87 authenticity_token = document.xpath(
88 "(//input[@name='authenticity_token']/@value)[1]"
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in _get_document_for_url(self, url)
210
211 def _get_document_for_url(self, url):
--> 212 content = self._get_content_for_url(url)
213
214 return lxml.html.document_fromstring(content)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in _get_content_for_url(self, *args, **kwargs)
206 def _get_content_for_url(self, *args, **kwargs):
207 return (
--> 208 self._get_request_for_url(*args, **kwargs).content.decode('utf8')
209 )
210
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in _get_request_for_url(self, url, send_token, headers, **kwargs)
201 url,
202 headers=headers,
--> 203 **kwargs
204 )
205
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py in get(self, url, **kwargs)
486 for multipart encoding upload.
487 :param auth: (optional) Auth tuple or callable to enable
--> 488 Basic/Digest/Custom HTTP Auth.
489 :param timeout: (optional) How long to wait for the server to send
490 data before giving up, as a float, or a :ref:`(connect timeout,
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
473 :param method: method for the new :class:`Request` object.
474 :param url: URL for the new :class:`Request` object.
--> 475 :param params: (optional) Dictionary or bytes to be sent in the query
476 string for the :class:`Request`.
477 :param data: (optional) Dictionary, list of tuples, bytes, or file-like
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
594
595 def patch(self, url, data=None, **kwargs):
--> 596 r"""Sends a PATCH request. Returns :class:`Response` object.
597
598 :param url: URL for the new :class:`Request` object.
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
495 raise
496
--> 497 except (ProtocolError, socket.error) as err:
498 raise ConnectionError(err, request=request)
499
SSLError: [Errno 2] No such file or directory