Install Python on Windows with Anaconda and Access RICOH THETA API

If you want to run Python scripts on Windows to access the RICOH THETA API v2.1 API, you may not have Python installed.

image

You can install Python from the Python site or with Anaconda (662MB download). I usually install Python directly from the Python site. However, as several online tutorials I use for both R and Django suggest using Anaconda, I decided to use the Anaconda distribution of Python on Windows 10 to run RICOH THETA client mode scripts.

As most of the tutorials and example code use Python 3.x now days, that is what I’ll focus on. Click on the link below to start the download.

I’m using this documentation from the Anaconda site.

Install as “Just Me”

image

I’m going to use Anaconda as the default Python 3.7 for my account.

image

The installation process took several minutes.

image

It will eventually show completed.

image

You do need to install PyCharm.

Start Anaconda Navigator
image

In this example, I am installing and using VS Code, a free open source editor If you are using a different editor, you can skip this step.

Create a test file such as hello.py and include print("hello, world")

In VS Code, you can check to see if your Python interpreter is using Anacoda by clicking on the lower left Python text. This text will not appear unless you have opened a Python file.

You can execute the file in the terminal inside of VS Code. Open the terminal from the top menu.

Run the Python script to make sure the Python installation is running.

image

Using RICOH THETA PythonTest Scripts

Install Python packages needed for test

install requests, zeroconf, pprint

image

Clone this repo:

Open Anaconda prompt

image

Run find-theta.py

Enable Python to work through Windows Firewall.

image

If find-theta.py does not work, get the IP address of the camera from another source such as your Wi-Fi router. You can also use the RICOH THETA mobile app to get the IP address.

Open simple-client.py

Adjust the settings below for your own camera.
image

Run simple-client.py

It should run these commands and take a picture:

get("info")
post("state")
takePicture()