spillai / numpy-opencv-converter

OpenCV <=> NumPy Converter using Boost::Python
BSD 2-Clause "Simplified" License
131 stars 52 forks source link

Could NOT find PythonLibs (missing: PYTHON_LIBRARIES) (found version "2.7.12") #6

Open titusnicolae opened 8 years ago

titusnicolae commented 8 years ago

I changed this to this -SET(PYTHON_LIBRARY "/usr/lib/python2.7/config/libpython2.7.so") +SET(PYTHON_LIBRARY "/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so")

However I still get this error:

`-- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'opencv' -- Found opencv, version 2.4.13 -- Boost version: 1.58.0 -- Found the following Boost libraries: -- python -- system -- Found PythonLibs: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so (found version "2.7.12") -- Boost version: 1.58.0 -- Found the following Boost libraries: -- python -- system CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find PythonLibs (missing: PYTHON_LIBRARIES) (found version "2.7.12") Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.5/Modules/FindPythonLibs.cmake:265 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake/boost-python.cmake:10 (find_package) CMakeLists.txt:26 (boost_python_module)

-- Configuring incomplete, errors occurred! See also "/home/nicolaetitus12/github/numpy-opencv-converter/build/CMakeFiles/CMakeOutput.log".`

pythonanonuser commented 8 years ago

Try commenting out the 2nd pythonlibs line:

SET(PYTHON_LIBRARY "/usr/lib/python2.7/config/libpython2.7.so")

hcl14 commented 8 years ago

Worked in my Ubuntu: install the following dependencies: sudo apt-get install python3-dev python3-pip python3-tk python3-lxml python3-six

titusnicolae commented 8 years ago

thanks, I'll try this again soon

charlielam0615 commented 7 years ago

I have the same problem. Installing python3-dev python3-pip python3-tk python3-lxml python3-six doesn't solve it. Give me the error:

-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   python
--   system
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find PythonLibs (missing: PYTHON_LIBRARIES) (found version
  "3.5.2")
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindPythonLibs.cmake:265 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/boost-python.cmake:10 (find_package)
  CMakeLists.txt:25 (boost_python_module)
hcl14 commented 7 years ago

I have the same problem. Installing python3-dev python3-pip python3-tk python3-lxml python3-six doesn't solve it. Give me the error:

Maybe you can try installing all the corresponding packages from Python 2.7 as well (at least that is possible to find), i.e. something like python-dev python-pip python-tk python-lxml python-six. You may use aptitude search python, etc. to find which are available. That's because I believe this error is due to some specific library missing.

charlielam0615 commented 7 years ago

There are tons of packages for python2.7, installing all of them would be unrealistic. I installed the packages you mentioned, but still no luck. Then I manually edited the CMakeCache.txt to set values for PYTHON_INCLUDE_DIR, PYTHON_LIBRARY, PYTHON_LIBRARY_DEBUG, PYTHON_LIBRARY_RELEASE, which were apparently not found as indicated by the NOT_FOUND value. Then I run cmake .. again, and make. Don't know if solved the problem, because then I ran into the problem of opencv3, as in issue #9. I guess something went wrong when cmake tries to find python library, don't know why.

dhontecillas commented 6 years ago

I tryied uncommenting a line in build_files/cmake/platform/platform_unix.cmake, around line 56, the one that says find_package(PythonLibs), and then started compiling. However, then I hit a different error:

In file included from /home/dhontecillas/prg/opensource/blender_git/blender/source/blender/freestyle/intern/application/../system/PythonInterpreter.h:55:0,
                 from /home/dhontecillas/prg/opensource/blender_git/blender/source/blender/freestyle/intern/application/Controller.cpp:53:
/home/dhontecillas/prg/opensource/blender_git/blender/source/blender/python/intern/bpy_capi_utils.h:31:4: error: #error "Python 3.6 or greater is required, you'll need to update your python."
 #  error "Python 3.6 or greater is required, you'll need to update your python."
    ^~~~~

So I guess I will have to add some deb repos to my Debian in order to update to python3.6

JeonSungYun commented 6 years ago

I tried to fit CMakeLists.txt to my Ubuntu.

/usr/lib/python2.7/config/libpython2.7.so ===> `/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so

but it doesn't work for me.

However, the following works well.

my local commit log is following :

-if (NOT PYTHON_INCLUDE_DIRS OR NOT PYTHON_LIBRARY)
-    SET(PYTHON_INCLUDE_DIRS "/usr/include/python2.7")
-    SET(PYTHON_LIBRARY "/usr/lib/python2.7/config/libpython2.7.so")
-endif()
+#if (NOT PYTHON_INCLUDE_DIRS OR NOT PYTHON_LIBRARY)
+#    SET(PYTHON_INCLUDE_DIRS "/usr/include/python2.7")
+#    SET(PYTHON_LIBRARY "/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so")
+#endif()
+include_directories("/usr/include/python2.7")

and then, I tried to edit cmake/boost-python.cmake a little because python 2 and 3 is installed on my Ubuntu. I don't know it is important but did it.

my local commit log is following:

-  find_package(PythonLibs REQUIRED)
+  find_package(PythonInterp 2.7 REQUIRED)
+  find_package(PythonLibs 2.7 REQUIRED)

I changed two files and the rest of README guidelines works well.

hanzhaogang commented 6 years ago

if you are using cmake v3.12 or later, use variable Python instead of PythonLibs and PythonInterp. see https://chttps://cmake.org/cmake/help/v3.12/module/FindPython.html

kanliot commented 5 years ago

simlar error occurs when "sword" data is missing.

doubleope commented 4 years ago

What file are you modifying? I'm having a similar error

henpel commented 3 years ago

if you are using cmake v3.12 or later, use variable Python instead of PythonLibs and PythonInterp. see https://chttps://cmake.org/cmake/help/v3.12/module/FindPython.html

Thanks!