| 298 | } |
| 299 | |
| 300 | void executePipListCommand(ScriptEngineInstance& pythonEngine) { |
| 301 | // TODO: seems like the CLI is picking up your virtualenvironment, so we manipulate sys.path to keep only the E+ folder for now |
| 302 | const std::string cmd = R"python( |
| 303 | import sys |
| 304 | sys.path = [x for x in sys.path if "EnergyPlus" in x] |
| 305 | import importlib.metadata |
| 306 | mods = sorted([f"{x.name}=={x.version}" for x in importlib.metadata.distributions()]) |
| 307 | [print(x) for x in mods] |
| 308 | )python"; |
| 309 | pythonEngine->exec(cmd); |
| 310 | } |
| 311 | |
| 312 | } // namespace cli |
| 313 | } // namespace openstudio |