Installation method when using RealSense from Python (pyenv edition)

If you refer to this link when using RealSense, it will work, but using pyenv is a bit of a hassle. I needed it, so I wrote a memo at that time.

image.png I thought this would work, but since the destination of sudo make install is not the folder of each version of pyenv, modules such as pyrealsense2 are not referenced in the environment switched by pyenv. Therefore, you need to make pyenv aware of modules such as pyrealsense2.

Check that the installation destination is output when sudo make install. image.png It looks like this in my environment

-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pybackend2.2.38.1.cpython-37m-darwin.so
-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pybackend2.2.cpython-37m-darwin.so
-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pybackend2.cpython-37m-darwin.so
-- Installing: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.2.38.1.cpython-37m-darwin.so
-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.2.38.cpython-37m-darwin.so
-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-37m-darwin.so

The most stable is

-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pybackend2.cpython-37m-darwin.so
-- Up-to-date: /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-37m-darwin.so

I'll link them. In my environment, I installed it via Brew, so it looked like the following. (Please go to your pyenv folder for each)

$ cd /usr/local/var/pyenv/versions/3.7.7/lib/python3.7/site-packages
$ ln -s /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pyrealsense2.cpython-37m-darwin.so pyrealsense2.so
$ ln -s /usr/local/Cellar/[email protected]/3.8.4/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyrealsense2/pybackend2.cpython-37m-darwin.so pybackend2.so

It is OK if you do this in the folder of each version

Recommended Posts

Installation method when using RealSense from Python (pyenv edition)
Minimum memo when using Python on Mac (pyenv edition)
Precautions when using phantomjs from python
Python installation method Windows
Causes when python version cannot be changed using pyenv
Minimum notes when using Python on Mac (Homebrew edition)
Flatten using Python yield from
python (pyenv + pyenv-virtualenv) + CentOS7 installation
Python installation (Mac edition) (old)
Change python version using pyenv
Install pyenv from Homebrew, install Python from pyenv
List of libraries to install when installing Python using Pyenv
Precautions when using pit in Python
Using Rstan from Python with PypeR
Error notification method when calling python from windows GUI or winsound.Beep
Introducing Python using pyenv on Ubuntu 20.04
Notes on using MeCab from Python
[Python] Error and solution memo when using venv with pyenv + anaconda
Using Cloud Storage from Python3 (Introduction)
Notes on installing Python using PyEnv
[Python] Be careful when using print
[2021 version] Python installation Windows 10 (64bit) edition
Install Python on CentOS using Pyenv
Error log output method when using Bottle framework on GAE / Python
Run Ansible from Python using API
Access spreadsheets using OAuth 2.0 from Python
When using MeCab with virtualenv python
Install Python on CentOS using pyenv
Precautions when using six with Python 2.5
[VS Code] ~ Tips when using python ~
When using regular expressions in Python
Try using Amazon DynamoDB from Python
Installation method using the pip command of the Python package (library) Mac environment
How to deal with OAuth2 error when using Google APIs from Python
Try using the Python web framework Django (1)-From installation to server startup
Precautions and error handling when calling .NET DLL from python using pythonnet
From Python to using MeCab (and CaboCha)
Periodic execution processing when using tkinter [Python3]
What Rubyist should know when using pyenv
Favicon placement (when using Python, Flask, Heroku)
[python, multiprocessing] Behavior for exceptions when using multiprocessing
I tried using UnityCloudBuild API from Python
Region extraction method using cellular automaton Try region extraction from the image with growcut (Python)
Python installation
I tried to execute Python code from .Net using Pythonnet (Hallo World edition)
Precautions when using OpenCV from Power Automate Desktop
#Monte Carlo method to find pi using Python
Install Python 3.8.6 on macOS Big Sur using pyenv
Make OpenCV3 available from python3 installed with pyenv
Character encoding when using csv module of python 2.7.3
Create wav file from GLSL shader using python3
Operate the schedule app using python from iphone
Run a Python file from html using Django
Load images from URLs using Pillow in Python 3
What I did when updating from Python 2.6 to 2.7
Document summary when using Cloud Firestore from Java
From easy git installation to docker startup python
Run a python script from excel (using xlwings)
Load test method when using external service API
What are you using when testing with Python?
I get an error when I try to raise Python to 3 series using pyenv on Catalina