-
Notifications
You must be signed in to change notification settings - Fork 50
Forpy on Windows
To link your project with the Python library follow the instructions in issue #7.
Steps for using forpy with the gfortran distribution bundled with Codeblocks
To build:
-
In Codeblocks: Project -> Build Options -> Linker Settings add
python37(depending on version) to "Link libraries" -
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:
-
When using Miniconda/Anaconda: Activate Python environment:
conda activate -
Setup MinGW environment vars outside of Codeblocks: Run
<path_to_Codeblocks>\MinGW\mingwvars.bat -
Set the environment variable
PYTHONHOMEto the path of your Python distribution. Setting environment variables in Windows: See Python docs
You can now run your executable outside of Codeblocks.
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)
- could not find
pythonXY.dll: activate your conda/virtualenv environment ->conda activate - could not find
libgcc_s_sjlj-1.dll: the MinGW runtime library could not be found -> see point 2. above - If you get the following error message then the Python standard library could not be found: set the
PYTHONHOMEenvironment variable to the path of your Python distribution. See point 3. above.
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'