Platform:macOS High Sierra
Hello,
I tried to use the method Building from source to install RDkit, there is something wrong when I entered cmake ..,the terminal shows that
CMake Warning at
/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/FindBoost.cmake:1723 (message):
No header defined for python-py36; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:202 (find_package)
CMake Error at /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.
Boost version: 1.67.0
Boost include path: /usr/local/include
Could not find the following Boost libraries:
boost_python
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
But I have added /usr/local/Cellar/boost/lib and /usr/local/Cellar/boost-python/lib to the ~/.bash_profile.
My ~/.bash_profile is written like this:
export RDBASE=/Users/wangzhicheng/Software/RDkit/rdkit-Release_2018_03_3
export PYTHONPATH=$RDBASE
export DYLD_LIBRARY_PATH=$RDBASE/lib:/usr/local/Cellar/boost/1.67.0_1/lib:/usr/local/Cellar/boost-python/1.67.0/lib:/usr/local/lib:/usr/local/Cellar/boost-python3/1.67.0_1/lib
export PATH="/Users/wangzhicheng/anaconda3/bin:$PATH"
By the way, I had already installed boost, boost-python3 by homebrew.
So where is the problem?
I think I've found the solution to this problem.
The reason for the problem cmake want to find libboost_python3.dylib in your library folder but in fact this file is called libboost_python3x.dylib(x is depended on your python version), so you just need to type following command in your terminal:
cd /usr/local/lib
sudo ln -s libboost_python3x.dylib libboost_python3.dylib
and you can solve this error!
Related
Due to some breakage in another project that didn't run in python3.10 I had to install python 3.9 on my ubuntu 22.04 machine. Because python3.9 is not available in the package repositories, I cloned the github repository and ran configure, make and make install, which installed python3.9 into /usr/local/bin.
Now I am trying to compile pivy against python3.10, which is my default python version. But I think CMake picks up python3.9 now by default. I tried reinstalling python with sudo apt install python3 --reinstall, but that didn't help. I also tried to replace all occurrences of python3.9 with python3.10 in the files generated by cmake, but that also gave an output of -- Found Python: /usr/local/bin/python3.9 (found version "3.9.13") found components: Interpreter Development Development.Module Development.Embed on the first line of make.
I have found a similar question, but it doesn't exactly match what I want. Firstly, I don't know what the installation directory for the apt python version is. the python binary is in /usr/bin/, but so could be the 3.9 version (it's in /usr/local/bin/ right now). Secondly, I would like to have that as the default.
I have tried removing the softlink to python3.9-config in /usr/local/bin/python3-config
and running python3-config now runs the one in /usr/bin/python3-config, which points to the 3.10 version. However running cmake now says it can't find python at all. Even after clearing the cmake cache and reseting the repository.
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python (missing: Python_EXECUTABLE Python_INCLUDE_DIRS
Python_LIBRARIES Interpreter Development Development.Module
Development.Embed)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindPython.cmake:561 (find_package_handle_standard_args)
CMakeLists.txt:17 (find_package)
I have tried creating a new softlink to the correct python3-config in /usr/local/bin, but that gave the same cmake error.
apt-file search FindPython revealed that that file is in the cmake-data package, which I reinstalled. That also didn't work.
I don't know what to do now. How can I make cmake find the correct python version by default? There are no entries for python or python3 in update-alternatives. I noticed there are a lot more python executables in /usr/local/bin/, for example python-argcomplete-tcsh, is that a problem if I want to use 3.10 by default?
I was able to get around the issue for now using
cmake .. -DCMAKE_BUILD_TYPE=Release -DPython_EXECUTABLE=/usr/bin/python3.10 -DPython_INCLUDE_DIRS=/usr/include/python3.10/
But that's only a stopgap measure. I would like a proper solution that makes FindPython work properly again.
I am trying to build the boost python library on my ubuntu. However, when I execute
./b2 --with-python
It always returns me errors related to
./boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
# include <pyconfig.h>
^~~~~~~~~~~~
I tried to look up online, e.g., https://github.com/boostorg/build/issues/289
Follow their suggestion I check my "project-config.jam"
And I found
# Python configuration
import python ;
if ! [ python.configured ]
{
using python : 3.7 : /home/lowlimb/anaconda3 :/home/lowlimb/anaconda3/include/python3.7m;
}
Which is correct, thus I really don't know how to fix this issue.
Can anyone provide me some advice?
In addition to installing the python dev libs as suggested by the other answers, you can specify the python path directly:
CPLUS_INCLUDE_PATH=/usr/include/python3.7 make
Or in your case something like:
CPLUS_INCLUDE_PATH=/home/lowlimb/anaconda3/include/python3.7 ./b2
This worked for me when compiling a projects using Boost Python where I got the same error.
pyconfig.h is installed with sudo apt install python-dev
To build with a specific python version, you can do
./bootstrap.sh --with-python=<path to python>
e.g.
./bootstrap.sh --with-python=python3
to use your system's python3 or
./bootstrap.sh --with-python=$VIRTUAL_ENV/bin/python
to use the python from your virtual environment.
In order to build Boost-Python or more generally, use Python from C/C++, you need the Python development files:
$ sudo apt install python3.7-dev
(windows 10, visual studio is installed, and I'm using visual studio's install location for python. (C:\Program Files (x86)\Microsoft Visual Studio\Shared))
I've been trying to build ultimaker cura's libarcus library. Luckily, vcpkg had all the dependencies Cmake needed except for python3-dev and python3-sip-dev. If you'd like to take a look at the directions/repo, it is here: https://github.com/Ultimaker/libArcus
at first I thought pip3 install sip would work fine, but it only installed a single python file (sip.pyd) and the distribution notes (sip-4.19.8.dist-info file). I need source code, or at least the entire release folder, I think. Could anyone with sip installed on debian, ubuntu, or linux confirm that there is more on those platforms?
here's the cmake output in case it might help, or I'm missing something. Any help is greatly appreciated.
implicitly converting '' to 'STRING' type.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:266 (_find_package):
By not providing "FindSIP.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SIP", but
CMake did not find one.
Could not find a package configuration file provided by "SIP" with any of
the following names:
SIPConfig.cmake
sip-config.cmake
Add the installation prefix of "SIP" to CMAKE_PREFIX_PATH or set "SIP_DIR"
to a directory containing one of the above files. If "SIP" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:37 (find_package)
Configuring incomplete, errors occurred!
```See also "C:/cura-git/deps/libarcus-build/CMakeFiles/CMakeOutput.log".
I am using Python for making a script to work with some chemical structures in my PhD. I want to install openbabel libraries for python. I tried my best but I could not install it on Windows. I posted a question earlier about installing it on Windows at How do I install openbabel for Python 3.6 in Windows 10? but could not find a solution. The solution installed the library but it does not work and could not connect to SWIG.
No I am trying to install it on my office computer which is a mac for past 5 hours but I could not figure what is going on.
I tried to install it from source code of Opnbabel and link it with python3 but it is making problem.
If I use the following command:
cmake ../ -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON
It successfully links it to Python 2.7 which I do not want. When I try the following options, it gives the error shown below:
cmake ../ -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON
OR
cmake ../ -DRUN_SWIG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib -DPYTHON_BINDINGS=ON
It gives the following error at the end after a lot of successful output:
-- Found PythonInterp: /usr/bin/python3.6 (found version "1.4")
-- Found SWIG: /usr/local/bin/swig (found version "3.0.12")
-- Found SWIG: /usr/local/bin/swig (found suitable version "3.0.12", minimum required is "2.0")
-- Found PythonLibs: /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib (found version "3.6.0")
-- Python bindings will be compiled
CMake Error at scripts/CMakeLists.txt:120 (install):
install TARGETS given no LIBRARY DESTINATION for module target
"bindings_python".
CMake Error at scripts/CMakeLists.txt:123 (install):
install FILES given no DESTINATION!
CMake Error at scripts/CMakeLists.txt:126 (install):
install FILES given no DESTINATION!
-- Configuring incomplete, errors occurred!
See also "/usr/local/Cellar/obabel/openbabel-master/ali/CMakeFiles/CMakeOutput.log".
See also "/usr/local/Cellar/obabel/openbabel-master/ali/CMakeFiles/CMakeError.log".
I am not sure why It detects the Python as v1.4 -- Found PythonInterp: /usr/bin/python3.6 (found version "1.4") instead of finding v.3.5.
I tried all the procedure with python 3.6 as well but the same errors occur. I am also using the openbabel obtained from github which was said to be working with these commands at the following post: http://forums.openbabel.org/OpenBabel-for-Python-3-td4659432.html
But it doesn't work as well.
Please help me as I require this module for my research.
Thanks
I found the solution for that. Here is the detailed solution:
Download Open Babel from its original source (https://github.com/openbabel/openbabel)
Extract it and cd into it (openbabel-master)
Make a directory “build” and cd into it.
RUN the following command:
cmake ../ -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.5/bin/python3 -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON
In the command above, the “-DPYTHON_EXECUTABLE” switch tells it the path where Python3 interpretor is found. You can check it by which python3 at a terminal.
make
make install
All Done! :)
So I've installed Boost via brew, similarly installed with cmake and python:
brew install boost --with-python3
brew install boost-python
brew install cmake
I'm currently using miniconda3 (python3.6) and am trying to install Dlib. So far I can install dlib fine, but when it comes to python setup, it fails. Dlib can be obtained by cloning the repo dlib_repo
Here I do python setup.py install, Getting the following errors
-- Detecting CXX compile features - done
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python-py34; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python-py35; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- python3
-- Found PythonLibs: /Users/userx/miniconda3/lib/libpython3.5.dylib (found suitable version "3.5.2", minimum required is "3.4")
-- USING BOOST_LIBS: /Users/userx/miniconda3/lib/libboost_python3.dylib
-- USING PYTHON_LIBS: /Users/userx/miniconda3/lib/libpython3.5.dylib
...
...
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o] Error 1
make[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
make: *** [all] Error 2
error: cmake build failed!
So here, I felt cmake couldn't find the boost variables, so I added these to my .bashrc and restarted my shell.
export BOOST_ROOT="/usr/local/Cellar/boost/1.63.0"
export BOOST_INCLUDE="/usr/local/Cellar/boost/1.63.0/include"
export BOOST_LIBDIR="/usr/local/Cellar/boost/1.63.0/lib"
Note these paths were found them via brew info and checked them to ensure correctness.
I'm using a macbook with Sierra OS - as I know Sierra has changed the way a lot of builds happen.
I have also tried to remove boost and download from the site and build directly, but same problem persists.
Any help much appreciated
It might be caused by the CMAKE_PREFIX_PATH setting.
I met the same problem and I solved it by this sequence:
First I install the boost using this:
brew install boost-python --with-python3
then I found the BOOST Not Found error when running the following commands to install the dlib 19.7.0:
pip install dlib --upgrade
So I edit the Bash Profile with following commands:
nano ~/.bash*le
and add the following line into this file:
export CMAKE_PREFIX_PATH="/usr/local:/usr/local/Cellar/boost/1.65.1:$PATH"
Notice
I am using the boost 1.65.1, which is installed at /usr/local/Cellar/boost/1.65.1, you might change it to the location that you install boost with brew.
after this step, I run pip install dlib --upgrade again on both python2.7.14 and 3.6.1 and 3.6.3, everything goes on the right way now.
I did the same in my system, except for one difference:
python3 setup.py install
Instead of
python setup.py install
And I don't see that error.