gufolabs / gufo_snmp Goto Github PK
View Code? Open in Web Editor NEWGufo SNMP is the accelerated Python SNMP library
License: Other
Gufo SNMP is the accelerated Python SNMP library
License: Other
Getting a FileNotFoundError exception if multiple instances of SnmpSession were previously used.
import asyncio
from gufo.snmp import SnmpSession
async def run_multiple_sessions() -> None:
for i in range(10):
async with SnmpSession(
addr="127.0.0.1",
community="public"
) as session:
async for _ in session.fetch("1.3.6.1.2.1.1"):
pass
asyncio.run(run_multiple_sessions())
Traceback (most recent call last):
File "/opt/gufo-snmp/run-multiple.py", line 13, in <module>
asyncio.run(run_multiple_sessions())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/opt/gufo-snmp/run-multiple.py", line 10, in run_multiple_sessions
async for _ in session.fetch("1.3.6.1.2.1.1"):
File "/opt/gufo-snmp/venv/lib/python3.9/site-packages/gufo/snmp/getbulk.py", line 74, in __anext__
loop.add_writer(self._fd, w_ev.set)
File "/usr/lib/python3.9/asyncio/selector_events.py", line 346, in add_writer
self._add_writer(fd, callback, *args)
File "/usr/lib/python3.9/asyncio/selector_events.py", line 304, in _add_writer
self._selector.modify(fd, mask | selectors.EVENT_WRITE,
File "/usr/lib/python3.9/selectors.py", line 390, in modify
self._selector.modify(key.fd, selector_events)
FileNotFoundError: [Errno 2] No such file or directory
3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110
0.1.0
Debian GNU/Linux 11 (bullseye)
tried installing the package on my MacBook Pro m3 pro laptop but it ran into a problem.
I have no issues on another laptop that runs ubuntu
pdm add gufo-snmp
(inetutils-python-3.12) sh-3.2# pdm add gufo-snmp
Adding packages to default dependencies: gufo-snmp
๐ Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove
โ Install gufo-snmp 0.5.0 failed
Retry failed jobs
โ Install gufo-snmp 0.5.0 failed
ERRORS:
add gufo-snmp failed:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/installers/synchronizers.py", line 285, in install_candidate
self.manager.install(can)
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/installers/manager.py", line 34, in install
dist_info = installer(str(prepared.build()), self.environment, prepared.direct_url())
^^^^^^^^^^^^^^^^
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/models/candidates.py", line 418, in build
self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/builders/wheel.py", line 28, in build
filename = self._hook.build_wheel(out_dir, config_settings, metadata_directory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pyproject_hooks/_impl.py", line 209, in build_wheel
return self._call_hook('build_wheel', {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pyproject_hooks/_impl.py", line 311, in _call_hook
self._subprocess_runner(
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/builders/base.py", line 261, in subprocess_runner
return log_subprocessor(cmd, cwd, extra_environ=env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/builders/base.py", line 107, in log_subprocessor
raise build_error(e) from None
pdm.exceptions.BuildError: Build backend raised error: Showing the last 10 lines of the build output:
adding license file 'LICENSE.md'
writing manifest file 'src/gufo_snmp.egg-info/SOURCES.txt'
running build_ext
running build_rust
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/_fast.cpython-312-darwin.so
error: failed to parse manifest at `/private/tmp/pdm-build-bffi8i33/Cargo.toml`
Caused by:
can't find `cri_decode` bench at `benches/cri_decode.rs` or `benches/cri_decode/main.rs`. Please specify bench.path if you want to use a non-default path.
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C 'link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/_fast.cpython-312-darwin.so'` failed
with code 101
3.12
0.5.0
macOS Sonoma 14.3.1
appreciate hardworking on this project. Is there any possible to support sync version rather that async only?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.