Skip to content

Commit 8239fbe

Browse files
authored
Merge pull request #1787 from reyoung/feature/fix_pyhome_error
Fix PyHome Setted in PythonUtil.cpp
2 parents 877df13 + d25357e commit 8239fbe

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

paddle/utils/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
enable_virtualenv.c
2-
PythonUtil.cpp

paddle/utils/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# The utilities for paddle
2-
3-
configure_file(PythonUtil.cpp.in ${PROJ_ROOT}/paddle/utils/PythonUtil.cpp)
4-
52
file(GLOB UTIL_HEADERS . *.h)
63
file(GLOB UTIL_SOURCES . *.cpp)
74
create_resources(enable_virtualenv.py enable_virtualenv.c)

paddle/utils/PythonUtil.cpp.in renamed to paddle/utils/PythonUtil.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,6 @@ extern const char enable_virtualenv_py[];
195195
}
196196
void initPython(int argc, char** argv) {
197197
#ifndef PADDLE_NO_PYTHON
198-
std::string pyHome;
199-
#if defined(__APPLE__) || defined(__OSX__)
200-
pyHome = "/usr/local/Frameworks/Python.framework/Versions/2.7";
201-
Py_SetPythonHome(const_cast<char*>(pyHome.c_str()));
202-
#endif
203-
pyHome = "@PYTHON_INSTALL_DIR@"; // NOLINT
204-
if (!pyHome.empty()) {
205-
Py_SetPythonHome(const_cast<char*>(pyHome.c_str()));
206-
}
207198
Py_SetProgramName(argv[0]);
208199
Py_Initialize();
209200
PySys_SetArgv(argc, argv);

0 commit comments

Comments
 (0)