Install & Compatibility
Where this runs
tested against v3.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.039s · 21MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.8s · import 0.034s · 22MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
vlog
✓ from ovs import vlog
vlog is a top-level module for logging
jsonrpc
✓ from ovs import jsonrpc
JSON-RPC utilities
db
✓ from ovs import db
Database access (OVSDB)
ovsdb
✓ from ovs import ovsdb
High-level OVSDB client
flow
✓ from ovs import flow
Flow table utilities
poll_loop
✓ from ovs import poll_loop
Event loop
posix
✓ from ovs import posix
POSIX socket helpers
poller
✓ from ovs import poller
Polling utilities
process
✓ from ovs import process
Process management
sFlow
✓ from ovs import sFlow
sFlow remote configuration
stream
✓ from ovs import stream
Stream abstraction (TCP/SSL/Unix)
timeval
✓ from ovs import timeval
Time utilities
unixctl
✓ from ovs import unixctl
Unix control socket
util
✓ from ovs import util
Miscellaneous utilities
version
✓ from ovs import version
Version info
Minimal example connecting to OVSDB via JSON-RPC and sending an echo request.
from ovs import vlog
from ovs import jsonrpc
from ovs import stream
import ovs.unixctl
import sys
# Example: connect to a remote OVSDB server via JSON-RPC
if __name__ == '__main__':
# Initialize logging
vlog.init()
# Create a stream to OVSDB (passing connection string)
# For SSL: ssl:127.0.0.1:6632
# For TCP: tcp:127.0.0.1:6640
# For Unix: unix:/var/run/openvswitch/db.sock
remote = 'tcp:127.0.0.1:6640'
new_stream, error = stream.Stream.open_block(
stream.Stream.open(remote))
if error:
sys.stderr.write('Failed to connect: %s\n' % error)
sys.exit(1)
rpc = jsonrpc.Connection(new_stream)
# Send a JSON-RPC echo request
request = jsonrpc.Message.create_request('echo', [])
rpc.send(request)
reply, error = rpc.recv_block()
if error:
sys.stderr.write('Error: %s\n' % error)
else:
print('Reply: %s' % reply)
rpc.close()
ovs-vsctl --version
Errors
Common errors & fixes
AttributeError: module 'ovs' has no attribute 'appctl'
The appctl module was deprecated and removed in ovs 3.0.
fixUse 'from ovs import unixctl' instead.
ImportError: cannot import name 'ovsdb' from 'ovs' (unknown location)
The ovsdb module is not always included in pip packages; it is part of the full OVS source distribution.
fixInstall OVS from source or use 'from ovs import db' for lower-level OVSDB access.
OSError: [Errno 2] No such file or directory: '/var/run/openvswitch/db.sock'
The OVS daemon (ovsdb-server) is not running or the socket path is wrong.
fixStart ovsdb-server: 'sudo service openvswitch-switch start'. Then check socket location with 'ovsdb-tool show-log'.
AttributeError: 'NoneType' object has no attribute 'recv_block'
Stream.open_block() returned an error, and rpc is None.
fixCheck the connection parameters. Use 'tcp:127.0.0.1:6640' or 'unix:/var/run/openvswitch/db.sock'.
Upgrade
Version history
3.7.1latest on PyPI · released Mar 31, 2026
Audit
Dependencies
No dependency data recorded yet.