提交 8239fbe6 编写于 作者: Y Yu Yang 提交者: GitHub

Merge pull request #1787 from reyoung/feature/fix_pyhome_error

Fix PyHome Setted in PythonUtil.cpp
enable_virtualenv.c enable_virtualenv.c
PythonUtil.cpp
# The utilities for paddle # The utilities for paddle
configure_file(PythonUtil.cpp.in ${PROJ_ROOT}/paddle/utils/PythonUtil.cpp)
file(GLOB UTIL_HEADERS . *.h) file(GLOB UTIL_HEADERS . *.h)
file(GLOB UTIL_SOURCES . *.cpp) file(GLOB UTIL_SOURCES . *.cpp)
create_resources(enable_virtualenv.py enable_virtualenv.c) create_resources(enable_virtualenv.py enable_virtualenv.c)
......
...@@ -195,15 +195,6 @@ extern const char enable_virtualenv_py[]; ...@@ -195,15 +195,6 @@ extern const char enable_virtualenv_py[];
} }
void initPython(int argc, char** argv) { void initPython(int argc, char** argv) {
#ifndef PADDLE_NO_PYTHON #ifndef PADDLE_NO_PYTHON
std::string pyHome;
#if defined(__APPLE__) || defined(__OSX__)
pyHome = "/usr/local/Frameworks/Python.framework/Versions/2.7";
Py_SetPythonHome(const_cast<char*>(pyHome.c_str()));
#endif
pyHome = "@PYTHON_INSTALL_DIR@"; // NOLINT
if (!pyHome.empty()) {
Py_SetPythonHome(const_cast<char*>(pyHome.c_str()));
}
Py_SetProgramName(argv[0]); Py_SetProgramName(argv[0]);
Py_Initialize(); Py_Initialize();
PySys_SetArgv(argc, argv); PySys_SetArgv(argc, argv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册