Compiling Firmware in Windows - Cannot install dependencies
 
Notifications
Clear all

Compiling Firmware in Windows - Cannot install dependencies  

  RSS
TickTock
(@ticktock)
Estimable Member
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.

Posted : 25/01/2025 7:26 pm
TickTock
(@ticktock)
Estimable Member
Topic starter answered:
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
Posted : 26/01/2025 12:33 pm
_KaszpiR_
(@_kaszpir_)
Prominent Member
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.

Posted : 26/01/2025 3:24 pm
miroslav.h4
(@miroslav-h4)
Honorable Member
RE: Compiling Firmware in Windows - Cannot install dependencies

When trying to compile the FW for MK4 I get the following output (the FW is without any modifications on my part, it's just a test to see if it will work):

C:\prusa\Buddy>python utils/build.py --preset mk4

Collecting aiohttp~=3.8 (from -r C:\prusa\Buddy\requirements.txt (line 1)) Using cached aiohttp-3.11.11-cp313-cp313-win_amd64.whl.metadata (8.0 kB)

Collecting click~=8.1.3 (from -r C:\prusa\Buddy\requirements.txt (line 2))

Using cached click-8.1.8-py3-none-any.whl.metadata (2.3 kB)

Collecting easyocr~=1.7 (from -r C:\prusa\Buddy\requirements.txt (line 3))

Using cached easyocr-1.7.2-py3-none-any.whl.metadata (10 kB)

Collecting ecdsa~=0.18 (from -r C:\prusa\Buddy\requirements.txt (line 4))

Using cached ecdsa-0.19.0-py2.py3-none-any.whl.metadata (29 kB)

Collecting littlefs-python==0.8 (from -r C:\prusa\Buddy\requirements.txt (line 5))

Using cached littlefs-python-0.8.0.tar.gz (480 kB)

Installing build dependencies: started

Installing build dependencies: finished with status 'done'

Getting requirements to build wheel: started

Getting requirements to build wheel: finished with status 'done'

Preparing metadata (pyproject.toml): started

Preparing metadata (pyproject.toml): finished with status 'done'

Collecting nanobind~=1.9 (from -r C:\prusa\Buddy\requirements.txt (line 6))

Using cached nanobind-1.9.2-py3-none-any.whl.metadata (1.4 kB)

Collecting numpy==1.26.4 (from -r C:\prusa\Buddy\requirements.txt (line 7))

Using cached numpy-1.26.4.tar.gz (15.8 MB)

Installing build dependencies: started

Installing build dependencies: finished with status 'done'

Getting requirements to build wheel: started

Getting requirements to build wheel: finished with status 'done'

Installing backend dependencies: started

Installing backend dependencies: finished with status 'done'

Preparing metadata (pyproject.toml): started

Preparing metadata (pyproject.toml): finished with status 'error'

error: subprocess-exited-with-error

Preparing metadata (pyproject.toml) did not run successfully.

exit code: 1

Traceback (most recent call last):

File "C:\prusa\Buddy\utils\build.py", line 837, in <module>

main()

~~~^^

File "C:\prusa\Buddy\utils\build.py", line 798, in main

bootstrap.bootstrap()

~~~~~~~~~~~~~~^^

File "C:\prusa\Buddy\utils\bootstrap.py", line 339, in bootstrap

install_pip_packages()

~~~~~~~~~~~~~~~^^

File "C:\prusa\Buddy\utils\bootstrap.py", line 325, in install_pip_packages

pip_install('-r', str(requirements_path))

~~~~~~~^^^^^^^^^^^^^^^^^^^^

File "C:\prusa\Buddy\utils\bootstrap.py", line 303, in pip_install

for line in iter(process.stdout.readline, ''):

       ~~~~^^^^^^^^^^^^^^^^^^^^^^

File "<frozen codecs>", line 325, in decode

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1272: invalid continuation byte

C:\prusa\Buddy>

 

Can anyone advise where I'm making a mistake?

Posted : 05/02/2025 9:59 am
Share: