pyrealsense: Can't install the library

When I tried to install (sudo python setup.py install), I got the followings. Do I need to copy rs.h by hand from librealsense?

running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing pyrealsense.egg-info/PKG-INFO
writing top-level names to pyrealsense.egg-info/top_level.txt
writing dependency_links to pyrealsense.egg-info/dependency_links.txt
reading manifest file 'pyrealsense.egg-info/SOURCES.txt'
writing manifest file 'pyrealsense.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.12-intel/egg
running install_lib
running build_py
copying pyrealsense/constants.py -> build/lib.macosx-10.12-intel-2.7/pyrealsense
running build_ext
building 'pyrealsense.rsutilwrapper' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/usr/local/include/librealsense -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pyrealsense/rsutilwrapper.c -o build/temp.macosx-10.12-intel-2.7/pyrealsense/rsutilwrapper.o
pyrealsense/rsutilwrapper.c:1:10: fatal error: 'rs.h' file not found
#include "rs.h"
         ^
1 error generated.
error: command 'cc' failed with exit status 1

I’m using macOS 10.12.2

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Also, I would leave the note to install OpenCV (cv2) on this Anaconda environment to run the sample file. It’s based on here (http://www.pyimagesearch.com/2016/11/28/macos-install-opencv-3-and-python-2-7/), but need some modification.

  • git clone https://github.com/opencv/opencv
  • git clone https://github.com/opencv/opencv_contrib
  • cd ~/opencv
  • mkdir build
  • cd build/
  • cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \     -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \     -D PYTHON2_LIBRARY=/Users/user_name/anaconda2/envs/pyrs/lib/libpython2.7.dylib \     -D PYTHON2_INCLUDE_DIR=/Users/user_name/anaconda2/envs/pyrs/include/python2.7 \     -D PYTHON2_EXECUTABLE=/Users/user_name/anaconda2/envs/pyrs/bin/python \     -D BUILD_opencv_python2=ON \     -D BUILD_opencv_python3=OFF \     -D INSTALL_PYTHON_EXAMPLES=ON \     -D INSTALL_C_EXAMPLES=OFF \     -D BUILD_EXAMPLES=ON ..
  • make -j4
  • sudo make install
  • cd /usr/local/lib/python2.7/site-packages/ (then check there is cv2.so in this directory)
  • cd /Users/user_name/anaconda2/envs/pyrs/lib/python2.7/site-packages
  • ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so

Thank you very much! I tried Anaconda and I could successfully install, though I needed to add sudo before python setup.py install(I got error: [Errno 13] Permission denied: 'pyrealsense.egg-info/PKG-INFO')