Pox: Filesystem Utilities

raw JSON →
0.3.7 verified Tue May 12 auth: no python install: verified

Pox is a Python library offering simple utilities for exploring and manipulating local and remote filesystems, and for automated build processes. It is currently at version 0.3.7 and maintains an active development status with regular minor updates.

pip install pox
error ImportError: No module named pox.core
cause This error often occurs when the POX library is not correctly installed as a Python package, or when there's a mismatch between the import statement and the actual directory structure, especially after cloning the repository directly. It can also stem from Python 2 vs. Python 3 compatibility issues, as older POX versions primarily supported Python 2.7.
fix
If installing via Git, ensure __init__.py files exist in relevant directories. If your project is a subdirectory of the cloned pox repository, you might need to adjust imports from from pox.core import ... to from pox.pox.core import .... For modern pox (uqfoundation), ensure Python 3.9+ is used and install with pip install pox. For older pox (noxrepo), use Python 2.7.
error AttributeError: 'IPAddr' object has no attribute 'split'
cause This error occurs when attempting to use string manipulation methods, such as `split()`, directly on an `IPAddr` object from `pox.lib.addresses`. The `IPAddr` object represents an IP address but is not a native Python string type.
fix
Convert the IPAddr object to its string representation first using the .toStr() method before applying string operations. For example, st.toStr().split('.') instead of st.split('.').
error WARNING:version:Support for Python 3 is experimental.
cause This warning indicates that you are likely running an older version of POX, which was originally developed for Python 2.7, with a Python 3 interpreter. While some functionality might work, core components or dependencies may not be fully compatible, leading to unexpected behavior or further errors.
fix
For older POX distributions (e.g., noxrepo/pox), use a Python 2.7 interpreter. If you intend to use POX with Python 3, ensure you are using the actively maintained pox library from the uqfoundation project, which supports Python 3.9+.
error AttributeError: 'YourControllerClass' object has no attribute 'connection'
cause This `AttributeError` typically arises in POX when a custom controller component or module tries to access an attribute like `connection` directly from its own instance (`self.connection`), but `connection` is actually an attribute of an event object (e.g., `event.connection`) that is passed to event handler functions within the controller.
fix
Ensure that you are accessing the connection attribute from the event object provided to your event handler. For instance, if you have an _handle_PacketIn method, use event.connection.send(fm) instead of self.connection.send(fm).
breaking Pox dropped formal support for Python 3.7.
fix Ensure your Python environment is version 3.8 or higher when using pox>=0.3.4.
breaking The minimum required Python version was increased from 3.7 to 3.8.
fix Upgrade your Python installation to version 3.8 or newer. For earlier Python versions, use pox<0.3.6.
breaking The minimum required Python version was further increased from 3.8 to 3.9.
fix Upgrade your Python installation to version 3.9 or newer. For Python 3.8, use pox<0.3.7.
breaking The `pox` module does not expose a `version()` method as part of its public API, leading to an `AttributeError` when `pox.version()` is called.
fix To get the installed package version, use `importlib.metadata.version('pox')` (for Python 3.8+) or `pkg_resources.get_distribution('pox').version`. If `pox.version()` refers to a specific library function, consult the `pox` documentation for the correct API.
breaking The `pox.version()` method is not available or has been removed from the `pox` library's API, leading to an `AttributeError`.
fix Consult the `pox` library documentation for the current method of checking its version, or update your code to remove the call to `pox.version()`.
python os / libc status wheel install import disk
3.10 alpine (musl) wheel - 0.02s 18.0M
3.10 alpine (musl) - - 0.02s 18.0M
3.10 slim (glibc) wheel 1.5s 0.01s 18M
3.10 slim (glibc) - - 0.01s 18M
3.11 alpine (musl) wheel - 0.03s 19.8M
3.11 alpine (musl) - - 0.03s 19.8M
3.11 slim (glibc) wheel 1.6s 0.02s 20M
3.11 slim (glibc) - - 0.03s 20M
3.12 alpine (musl) wheel - 0.02s 11.7M
3.12 alpine (musl) - - 0.03s 11.7M
3.12 slim (glibc) wheel 1.4s 0.02s 12M
3.12 slim (glibc) - - 0.03s 12M
3.13 alpine (musl) wheel - 0.02s 11.4M
3.13 alpine (musl) - - 0.03s 11.3M
3.13 slim (glibc) wheel 1.4s 0.02s 12M
3.13 slim (glibc) - - 0.03s 12M
3.9 alpine (musl) wheel - 0.02s 17.5M
3.9 alpine (musl) - - 0.02s 17.5M
3.9 slim (glibc) wheel 1.8s 0.01s 18M
3.9 slim (glibc) - - 0.01s 18M

This quickstart demonstrates how to import the pox library and retrieve its version, license, and citation information.

import pox

# Get the library version
print(f"Pox Version: {pox.version()}")

# Display the license information
print("\n--- License ---")
print(pox.license())

# Display citation information
print("\n--- Citation ---")
print(pox.citation())