Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1787 from reyoung/feature/fix_pyhome_…
Browse files Browse the repository at this point in the history
…error

Fix PyHome Setted in PythonUtil.cpp
  • Loading branch information
reyoung authored Apr 15, 2017
2 parents 877df13 + d25357e commit 8239fbe
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion paddle/utils/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enable_virtualenv.c
PythonUtil.cpp
3 changes: 0 additions & 3 deletions paddle/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# The utilities for paddle

configure_file(PythonUtil.cpp.in ${PROJ_ROOT}/paddle/utils/PythonUtil.cpp)

file(GLOB UTIL_HEADERS . *.h)
file(GLOB UTIL_SOURCES . *.cpp)
create_resources(enable_virtualenv.py enable_virtualenv.c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,6 @@ extern const char enable_virtualenv_py[];
}
void initPython(int argc, char** argv) {
#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_Initialize();
PySys_SetArgv(argc, argv);
Expand Down

0 comments on commit 8239fbe

Please sign in to comment.