You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nanoresearch health crashes with NameError: name 'os' is not defined in discover_environments() on Windows #2
Running nanoresearch health on Windows crashes during environment discovery because nanoresearch/agents/runtime_env/_discovery.py uses os.environ / os.path.expanduser(...) without importing os.
Environment
OS: Windows 11
Shell: PowerShell
Python: conda environment
Project path: D:\NanoResearch
Steps to reproduce
Clone the repo on Windows.
Create and activate a conda environment.
Install the project in editable mode.
Run:
nanoresearch health
Actual behavior
The command crashes with:
NameError:` name 'os' is not defined
Traceback excerpt:
File "D:\NanoResearch\nanoresearch\agents\runtime_env_discovery.py", line 85, in discover_environments
pyenv_root = os.environ.get("PYENV_ROOT") or os.path.expanduser("~/.pyenv")
NameError: name 'os' is not defined
Expected behavior
nanoresearch health should complete normally and report detected Python environments.
Root cause
nanoresearch/agents/runtime_env/_discovery.py references os.environ and os.path.expanduser(...) but does not import os.
Suggested fix
Add the missing import at the top of nanoresearch/agents/runtime_env/_discovery.py:
import os
For example:
from __future__ importannotationsimportjsonimportloggingimportosimportplatformimportreimportshutilimportsubprocessfrompathlibimportPathfromtypingimportAny
Hi @cqyzc99, thanks for reporting this!Fixed in 283374b. The missing import os has been added to _discovery.py. We also audited the rest of the codebase and fixed 4other files with the same kind of missing stdlib imports (re, shutil).Please pull the latest main and let us know if the issue persists. Thanks again for catching this!
Activity
YujunWu03 commentedon Mar 20, 2026
Hi @cqyzc99, thanks for reporting this!Fixed in 283374b. The missing import os has been added to _discovery.py. We also audited the rest of the codebase and fixed 4other files with the same kind of missing stdlib imports (re, shutil).Please pull the latest main and let us know if the issue persists. Thanks again for catching this!
fix: add missing stdlib imports across 5 modules (closes #2)
fix: add missing stdlib imports across 5 modules (closes #2)
fix: add missing stdlib imports across 5 modules (ref #2)
§3.5 Day 4 S4 cross-section three-way: writing comment injection + re…