Open jbensabat opened 3 years ago
I get the same error but with ModuleNotFoundError: No module named 'matplotlib' Any fixes yet?
I ran into both of these, because my Anaconda environment was not activated: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment. If you use their solution of running the activation script in the Command Prompt, it sets the proper environment variables, but those are not persistent. You can take note of what environment variables it sets and set yourself manually, or you can reinstall Anaconda with the option of setting the environment variables. Anaconda does not recommend doing that, but I haven't seen an issue so far.
I ran into the same problem as you
I added this code at the beginning of the main function to set the environment variables
Py_SetPythonHome(L"C:/Users/UesrName/anaconda3/envs/EnvName");
and it will run correctly.
This path is the location of your python interpreter.
Hello I have installed matplotlibcpp with the CMAKE GUI I have previously installed the python libs through anaconda (miniconda3)
Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = 'plotting' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = 'C:\matplotlibcpp\build\bin\Release\bar.exe' sys.base_prefix = 'C:\Miniconda3' sys.base_exec_prefix = 'C:\Miniconda3' sys.platlibdir = 'lib' sys.executable = 'C:\matplotlibcpp\build\bin\Release\bar.exe' sys.prefix = 'C:\Miniconda3' sys.exec_prefix = 'C:\Miniconda3' sys.path = [ 'C:\Miniconda3\python39.zip', '.\DLLs', '.\lib', 'C:\matplotlibcpp\build\bin\Release', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings'
Current thread 0x000015dc (most recent call first):