Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew reinstall boost-python with python 3? #118

Open
jefio opened this issue Feb 11, 2018 · 6 comments
Open

brew reinstall boost-python with python 3? #118

jefio opened this issue Feb 11, 2018 · 6 comments

Comments

@jefio
Copy link

jefio commented Feb 11, 2018

Using mac OS X 10.13.3, anaconda python 3. Following the installation instructions, brew reinstall boost-python --without-python --with-python3 --build-from-source succeeds but outputs the following warnings:

$ brew reinstall boost-python --without-python --with-python3 --build-from-source
==> Reinstalling boost-python
Warning: boost-python: this formula has no --with-python3 option so it will be ignored!
Warning: boost-python: this formula has no --without-python option so it will be ignored!
==> Downloading https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2
Already downloaded: /Users/jef/Library/Caches/Homebrew/boost-python-1.66.0.tar.bz2
==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost-python/1.66.0_1 --libdir=/usr/local/Cellar/boost-python/1.66.0_1/lib --with-libraries=python --with-python=python
==> ./b2 --build-dir=build-python --stagedir=stage-python python=2.7 --prefix=/usr/local/Cellar/boost-python/1.66.0_1 --libdir=/usr/local/Cellar/boost-python/1.66.0_1/lib -d2 -j4
🍺  /usr/local/Cellar/boost-python/1.66.0_1: 457 files, 17.3MB, built in 4 minutes 43 seconds

After that, pip install -e $ROBOSCHOOL_PATH fails with the following error:

$ pip install -e $ROBOSCHOOL_PATH
[...]
    ld: library not found for -lboost_python3
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [../cpp_household.so] Error 1
    cd /Users/jef/work/code/source/roboschool/roboschool/cpp-household && make clean && make -j4 dirs  ../cpp_household.so

    C++ dependencies for this project are:

    bullet
    tinyxml
    boost_python
    assimp
    Qt5

    If you see compilation error FIRST THING TO CHECK if pkg-config call was successful.
    Install dependencies that pkg-config cannot find.


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /Users/jef/work/code/source/roboschool/
@backpropper
Copy link

backpropper commented Feb 12, 2018

Same error! Even removing the postfix 3 does not help.

@tmahlstrom
Copy link

Same problem here :/

@cpacker
Copy link

cpacker commented Feb 22, 2018

Try installing boost-python3 instead - I had the same warnings / errors and it worked for me.

@jefio
Copy link
Author

jefio commented Feb 22, 2018

@cpacker Thank you! Your suggestion helped me run pip3 install -e $ROBOSCHOOL_PATH successfully. However I still ran into other problems afterwards. I ended up doing this:

  • Note that I had to use Homebrew python instead of Anaconda python (because of this problem)
  • In the installation instructions for Homebrew python, as suggested by @cpacker, I replaced brew reinstall boost-python --without-python --with-python3 --build-from-source by brew install boost-python3
  • Before running pip3 install -e $ROBOSCHOOL_PATH, I had to edit roboschool/cpp-household/render-simple.cpp and roboschool/cpp-household/render-glwidget.cpp (see how and why here)

After that I was finally able to run the two examples from the README:

python $ROBOSCHOOL_PATH/agent_zoo/RoboschoolHumanoidFlagrun_v0_2017may.py
python $ROBOSCHOOL_PATH/agent_zoo/demo_race2.py

@lizixroy
Copy link

lizixroy commented Jun 4, 2018

I had the same issue and simply installing boost-python3 didn't help (not quite).

I checked the /usr/local/lib directory where boost_python3 library is supposed to be placed and it's where gcc will search for libraries during linking. It turns out the intended library was named:

libboost_python36.a
libboost_python36.dylib	

rather than "libboost_python3.a" or "libboost_python3. dylib".

I modified the Makefile inside the /roboschool/cpp-household directory:

"BOOST_PYTHON3_POSTFIX = 3" to "BOOST_PYTHON3_POSTFIX = 36"

Then installation succeeded:

"Successfully installed roboschool"

@jinntrance
Copy link

After installing boost-python3 by brew install boost-python3, try the following code:

ln -s /usr/local/lib/libboost_python36.a /usr/local/lib/libboost_python3.a 
ln -s /usr/local/lib/libboost_python36.dylib /usr/local/lib/libboost_python3.dylib 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants