Closed lilt3ddy closed 1 year ago
Hello! It sounds like you're generally on the right track. Ultimately, the goal is for whatever environment you're using GillesPy2 from to be able to access the g++
program. The usual process for this is to install MinGW locally and add the bin/
folder from this installation to your PATH
.
This depends on your environment rather than your editor; I'm unsure what is being referred to when you say you installed C++ to VSCode. Regardless, your PATH
is a list of folders for your system to check for executables. For example, if a program depends on g++.exe
, the assumption is that one of the folders in your PATH
is a folder that contains g++.exe
. There are a few things you can check here.
# check for the g++ executable
import shutil
print(shutil.which("g++")) # will print None if it's not found
import os print(os.environ.get("PATH")).split(";")
2. Ensure that `g++.exe` is actually present. Some MSYS2/MinGW installations prefix their build tool commands, for example `g++` will actually be called `mingw32-g++.exe` or something like that. If `g++` is not present but one of the prefixed versions are, you can copy/rename this executable to `g++.exe` so it is discoverable by any software that requires `g++`. You can check this by opening a terminal (PowerShell, cmd, Git bash, etc.) and running the command `g++ --version`.
If both of these seem okay outside of your editor, it may be an issue with the configuration of your editor/environment. I'm unfortunately not particularly familiar with VSCode's Python integration. In this case, I would consult your editor's documentation for setting up your environment.
If you have any further questions, please re-open this issue.
I have created a local environment using venv. I have then installed gillespy2. When I'm running my code I get the following:
"2023-04-03 16:28:55,562 - GillesPy2 - WARNING - Unable to use C++ optimized solvers due to one or more missing dependencies: ['g++']. The performance of this package can be significantly increased if you install/configure these on your machine."
What I've tried to do to fix this is the following:
1: Install C++ to vscode 2: Download Mingw-w64 and try to add a path to Mingw-w64 bin folder to the Windows PATH environment variable (don't really know what this means, I just followed the steps on https://code.visualstudio.com/docs/cpp/config-mingw).
However I don't really know what I'm doing and if I'm approaching the problem correctly. Any advice on how I should move forward would be much appreciated.
(I'm coding in Python with VS Code).