@@ -120,7 +120,7 @@ def _check_package_installed(self, package_name: str) -> bool:
120120 try :
121121 result = subprocess .run (
122122 [sys .executable , "-m" , "pip" , "show" , package_name ],
123- capture_output = True , text = True , timeout = 10
123+ capture_output = True , text = True , encoding = "utf-8" , errors = "replace" , timeout = 10
124124 )
125125 return result .returncode == 0
126126 except Exception :
@@ -178,7 +178,7 @@ def install_packages(self) -> bool:
178178 try :
179179 result = subprocess .run ([
180180 sys .executable , "-m" , "pip" , "install" , "-q" , pkg_spec
181- ], capture_output = True , text = True , timeout = 120 )
181+ ], capture_output = True , text = True , encoding = "utf-8" , errors = "replace" , timeout = 120 )
182182
183183 if result .returncode == 0 :
184184 progress .update (task , description = f"[green]✅ { pkg_name } [/green]" )
@@ -215,7 +215,7 @@ def install_packages(self) -> bool:
215215 try :
216216 result = subprocess .run ([
217217 sys .executable , "-m" , "pip" , "install" , "-q" , "-e" , "."
218- ], cwd = self .config .project_root , capture_output = True , text = True , timeout = 120 )
218+ ], cwd = self .config .project_root , capture_output = True , text = True , encoding = "utf-8" , errors = "replace" , timeout = 120 )
219219
220220 if result .returncode == 0 :
221221 progress .update (task , description = "[green]✅ Tiny🔥Torch installed[/green]" )
@@ -238,7 +238,7 @@ def install_packages(self) -> bool:
238238 "--user" ,
239239 "--name" , "tinytorch" ,
240240 "--display-name" , "TinyTorch (Python 3)"
241- ], capture_output = True , text = True , timeout = 60 )
241+ ], capture_output = True , text = True , encoding = "utf-8" , errors = "replace" , timeout = 60 )
242242
243243 if result .returncode == 0 :
244244 self .console .print ("[green]✅ Jupyter kernel 'tinytorch' registered[/green]" )
@@ -304,7 +304,7 @@ def create_virtual_environment(self, force: bool = False) -> bool:
304304 # Check actual hardware
305305 hw_check = sp .run (
306306 ["sysctl" , "-n" , "machdep.cpu.brand_string" ],
307- capture_output = True , text = True
307+ capture_output = True , text = True , encoding = "utf-8" , errors = "replace"
308308 )
309309 if "Apple" in hw_check .stdout :
310310 self .console .print ("[yellow]⚠️ Detected Apple Silicon but Python is running in Rosetta (x86_64)[/yellow]" )
@@ -319,12 +319,12 @@ def create_virtual_environment(self, force: bool = False) -> bool:
319319 result = subprocess .run (
320320 f'{ python_exe } -m venv { venv_path } ' ,
321321 shell = True ,
322- capture_output = True , text = True
322+ capture_output = True , text = True , encoding = "utf-8" , errors = "replace"
323323 )
324324 else :
325325 result = subprocess .run ([
326326 python_exe , "-m" , "venv" , str (venv_path )
327- ], capture_output = True , text = True )
327+ ], capture_output = True , text = True , encoding = "utf-8" , errors = "replace" )
328328
329329 if result .returncode != 0 :
330330 self .console .print (f"[red]Failed to create virtual environment: { result .stderr } [/red]" )
@@ -339,7 +339,7 @@ def create_virtual_environment(self, force: bool = False) -> bool:
339339 if venv_python .exists ():
340340 arch_check = subprocess .run (
341341 [str (venv_python ), "-c" , "import platform; print(platform.machine())" ],
342- capture_output = True , text = True
342+ capture_output = True , text = True , encoding = "utf-8" , errors = "replace"
343343 )
344344 if arch_check .returncode == 0 :
345345 venv_arch = arch_check .stdout .strip ()
@@ -476,7 +476,7 @@ def check_jupyter_kernel(self) -> bool:
476476 try :
477477 result = subprocess .run (
478478 [sys .executable , "-m" , "jupyter" , "kernelspec" , "list" ],
479- capture_output = True , text = True , timeout = 10
479+ capture_output = True , text = True , encoding = "utf-8" , errors = "replace" , timeout = 10
480480 )
481481 return result .returncode == 0 and "tinytorch" in result .stdout
482482 except Exception :
0 commit comments