there are similar questions on StackOverflow, but I couldnt find any helpful. I am embedding python in c++ in visual studio. My python is in anaconda, and the directory for anaconda is c:/anaconda2, my code is very simple
#include <Python.h>
int main()
{
Py_initialize();
}
I am so surprised even this simple code generates the error
ImportError: No module named site
And I have set PYTHONHOME=c:\Anaconda2\python27
, PYTHONPATH=c"\Anaconda2\libs
, and appended PYTHONHOME
and PYTHONPATH
to system variable path
. I also put C:\Anaconda2\libs\python27
into Library Directories
in the property sheets. But I still getting this ImportError
, can anyone please help?