Compiling Firmware in Windows - Cannot install dependencies
I am following the steps for setting up Visual Studio here:
https://github.com/prusa3d/Prusa-Firmware#windows
Fresh install, latest version of VS, CMake, Python, Bash
Everything goes well until the point I am to install dependencies via the python commad:
python .\utils\bootstrap.py
I get the following error:
PS C:\prusa\Prusa-Firmware> python .\utils\bootstrapnv.pyDownloading cmake-3.22.5Traceback (most recent call last): File "C:\Python\lib\urllib\request.py", line 1317, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\Python\lib\http\client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Python\lib\http\client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\Python\lib\http\client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Python\lib\http\client.py", line 1004, in _send_output self.send(msg) File "C:\Python\lib\http\client.py", line 944, in send self.connect() File "C:\Python\lib\http\client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "C:\Python\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\Python\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\Python\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake()ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certific
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File ".\utils\bootstrapnv.py", line 199, in <module> sys.exit(main()) File ".\utils\bootstrapnv.py", line 182, in main install_dependency(dependency) File ".\utils\bootstrapnv.py", line 137, in install_dependency download_and_unzip(url=url, directory=installation_directory) File ".\utils\bootstrapnv.py", line 82, in download_and_unzip f, _ = urlretrieve(url, filename=None) File "C:\Python\lib\urllib\request.py", line 247, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: File "C:\Python\lib\urllib\request.py", line 222, in urlopeno_open raise URLError(err)urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)> PS C:\prusa\Prusa-Firmware>
Did some digging and found the fix for this, apparently, is to upgrade the cert in the python install directory:
pip install --upgrade certifi
I did this and it indicates success. However, I get the same certificate has expired message when I run the bootstrap.py. Attempting to upgrade the certificate again results in a message that the certificate has already been updated.
I don't know where to go from here. Any suggestions would be welcome.
RE: Compiling Firmware in Windows - Cannot install dependencies
OK. I finally found a solution. Going to leave here for anyone else who encounter this. Add the following to the bootstrap.py file:
It should be noted that this bypasses the ssl security...
import urllib.request import ssl # Create an unverified SSL context ssl._create_default_https_context = ssl._create_unverified_context
RE: Compiling Firmware in Windows - Cannot install dependencies
maybe there is an old certifi package in the virtualenv, thus upgrading system level package is not enough.
This should be reported as GitHub issue.
See my GitHub and printables.com for some 3d stuff that you may like.