Can you use a python virtual environment for "mhrc.automation" PSCAD Automation package?
I can get mhrc.automation to work with Python (v3.10) if I call it from the global environment. However, I prefer to use python virtual environments (venv or pipenv) rather than pollute the global environment with too many (potentially conflicting) packages.
Can "import mhrc.automation" work in a virtual environment or is it only used from the global?
From "C:\Users\***\AppData\Local\Programs\Python\Python310\Lib\site-packages" I copied the "mhrc" folder into my python working directory so it becomes its own package inside the folder. In the virtual environment, I used "pip install pywin32" to add this package's dependencies to the venv (while venv is activated). While it's still polluting the global environment, hopefully it's not causing conflictions down the line.
By
Figured out a workaround, although not ideal.
From "C:\Users\***\AppData\Local\Programs\Python\Python310\Lib\site-packages" I copied the "mhrc" folder into my python working directory so it becomes its own package inside the folder. In the virtual environment, I used "pip install pywin32" to add this package's dependencies to the venv (while venv is activated). While it's still polluting the global environment, hopefully it's not causing conflictions down the line.
Add New Comment