Skip to content

Forpy on Windows

Elias Rabel edited this page Nov 15, 2019 · 3 revisions

Forpy on Windows

Using Visual Studio

To link your project with the Python library follow the instructions in issue #7.

Using Codeblocks + MinGW

Steps for using forpy with the gfortran distribution bundled with Codeblocks

To build:

  1. In Codeblocks: Project -> Build Options -> Linker Settings add python37 (depending on version) to "Link libraries"

  2. In the tab "Search directories" -> Linker add the path to your Python distribution For example when using Miniconda3: C:\Users\username\Miniconda3

You can now build your executable in Codeblocks, however running in Codeblocks will give an error. To run your executable outside of Codeblocks:

  1. When using Miniconda/Anaconda: Activate Python environment: conda activate

  2. Setup MinGW environment vars outside of Codeblocks: Run <path_to_Codeblocks>\MinGW\mingwvars.bat

  3. Set the environment variable PYTHONHOME (not PYTHONPATH!) to the path of your Python distribution. Setting environment variables in Windows: See Python docs

You can now run your executable outside of Codeblocks.

Using matplotlib

When using matplotlib you might get the error could not find or load the Qt platform plugin "windows". To fix this set the environment variable QT_PLUGIN_PATH to <path_to_Python_distribution>\Library\plugins (source)

Clone this wiki locally