[linux] pip3 install octodns
Geert Stappers
stappers op paddy.gpm.stappers.nl
Ma Feb 3 21:37:47 CET 2025
Hoi,
Blijkt dat "octodns" niet als package beschikbaar is voor mijn favoriete
Linux distribution. Dan maar het risico van packages mixen, dacht ik.
Vandaag geleerd dat `pip3` mij beschermd tegen het gevaar van vermengen
van "python packages onder beheer van apt" en "python packages onder
beheer van pip".
De oplossing, het voorkomen van problemen, is "virtual environment".
Maar voordat ik `python3 -m venv dir/ec/tory` kon doen,
moest ik eerst package 'python3-venv' installeren.
Kortste weg naar het doel, achteraf gezien:
sudo apt install python3-venv
python3 -m venv dir/ec/tory
source dir/ec/tory/bin/activate
pip3 install octodns
Doe je voordeel met mijn ervaring.
Groeten
Geert Stappers
Wat volgt is de weg van vallen en opstaan.
stappers op paddy:~
$ pip3 install octodns
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.13/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
stappers op paddy:~
$ python3 -m venv ~/octodns_venv
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.13-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: /home/stappers/octodns_venv/bin/python3
stappers op paddy:~
$ sudo apt install python3-venv
De volgende pakketten zijn automatisch geïnstalleerd en zijn niet langer nodig:
coinor-libcoinmp1v5 libgdal35 libpython3.12-dev libsuperlu6 python3-py python3.12-dev
Gebruik 'sudo apt autoremove' om ze te verwijderen.
Installeren:
python3-venv
Installeren van vereisten:
python3.13-venv
Samenvatting:
Opwaarderen: 0, Installeren: 2, Verwijderen: 0, Niet opwaarderen: 2794
Downloadgrootte: 6.652 B
Benodigde ruimte: 33,8 kB / 11,9 GB beschikbaar
Doorgaan? [J/n]
Ophalen:1 http://deb.debian.org/debian unstable/main amd64 python3.13-venv amd64 3.13.1-3+b1 [5.472 B]
Ophalen:2 http://deb.debian.org/debian unstable/main amd64 python3-venv amd64 3.13.1-2 [1.180 B]
6.652 B opgehaald in 0s (36,5 kB/s)
Voorheen niet geselecteerd pakket python3.13-venv wordt geselecteerd.
(Database wordt ingelezen ... 554503 bestanden en mappen momenteel geïnstalleerd.)
Uitpakken van .../python3.13-venv_3.13.1-3+b1_amd64.deb wordt voorbereid...
Bezig met uitpakken van python3.13-venv (3.13.1-3+b1) ...
Voorheen niet geselecteerd pakket python3-venv wordt geselecteerd.
Uitpakken van .../python3-venv_3.13.1-2_amd64.deb wordt voorbereid...
Bezig met uitpakken van python3-venv (3.13.1-2) ...
Instellen van python3.13-venv (3.13.1-3+b1) ...
Instellen van python3-venv (3.13.1-2) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
Restarting services...
Service restarts being deferred:
systemctl restart NetworkManager.service
/etc/needrestart/restart.d/dbus.service
systemctl restart lightdm.service
systemctl restart systemd-logind.service
systemctl restart unattended-upgrades.service
systemctl restart virtlogd.service
systemctl restart wpa_supplicant.service
No containers need to be restarted.
User sessions running outdated binaries:
stappers @ session #3: bash[3116,3200,3210,3249,3858], chromium[2091190,2091212,2091213,2091215],
dbus-daemon[577661], firefox-esr[2911], gvfsd[577675], lightdm[2428], xfce4-notifyd[577664],
xfce4-panel[2845], xfce4-session[2514]
stappers @ user manager service: at-spi-bus-laun[2629], gvfsd[2680], systemd[2436]
No VM guests are running outdated hypervisor (qemu) binaries on this host.
stappers op paddy:~
$ python3 -m venv ~/octodns_venv
stappers op paddy:~
$ ls ~/octodns_venv/
bin include lib lib64 pyvenv.cfg
stappers op paddy:~
$ command -v pip3
/usr/bin/pip3
stappers op paddy:~
$ source octodns_venv/bin/activate
(octodns_venv) stappers op paddy:~
$ command -v pip3
/home/stappers/octodns_venv/bin/pip3
(octodns_venv) stappers op paddy:~
$ pip3 install octodns
Collecting octodns
Using cached octodns-1.10.0-py3-none-any.whl.metadata (32 kB)
Collecting PyYaml>=4.2b1 (from octodns)
Downloading PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting dnspython>=2.2.1 (from octodns)
Using cached dnspython-2.7.0-py3-none-any.whl.metadata (5.8 kB)
Collecting fqdn>=1.5.0 (from octodns)
Using cached fqdn-1.5.1-py3-none-any.whl.metadata (1.4 kB)
Collecting idna>=3.3 (from octodns)
Using cached idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting natsort>=5.5.0 (from octodns)
Using cached natsort-8.4.0-py3-none-any.whl.metadata (21 kB)
Collecting python-dateutil>=2.8.1 (from octodns)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.1->octodns)
Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Using cached octodns-1.10.0-py3-none-any.whl (102 kB)
Using cached dnspython-2.7.0-py3-none-any.whl (313 kB)
Using cached fqdn-1.5.1-py3-none-any.whl (9.1 kB)
Using cached idna-3.10-py3-none-any.whl (70 kB)
Using cached natsort-8.4.0-py3-none-any.whl (38 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Downloading PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (759 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 759.5/759.5 kB 857.1 kB/s eta 0:00:00
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, PyYaml, natsort, idna, fqdn, dnspython, python-dateutil, octodns
Successfully installed PyYaml-6.0.2 dnspython-2.7.0 fqdn-1.5.1 idna-3.10 natsort-8.4.0 octodns-1.10.0 python-dateutil-2.9.0.post0 six-1.17.0
(octodns_venv) stappers op paddy:~
$ octodns-[TAB][TAB]
octodns-compare octodns-dump octodns-report octodns-sync octodns-validate octodns-versions
(octodns_venv) stappers op paddy:~
$ octodns-dump help
usage: octodns-dump [-h] --config-file CONFIG_FILE --output-dir OUTPUT_DIR
[--output-provider OUTPUT_PROVIDER] [--lenient] [--split] [--version]
[--log-stream-stdout] [--log-syslog] [--syslog-device SYSLOG_DEVICE]
[--syslog-facility SYSLOG_FACILITY] [--debug] [--quiet]
[--logging-config LOGGING_CONFIG]
zone source [source ...]
octodns-dump: error: the following arguments are required: --config-file, --output-dir, source
(octodns_venv) stappers op paddy:~
$ octodns-dump -h
usage: octodns-dump [-h] --config-file CONFIG_FILE --output-dir OUTPUT_DIR
[--output-provider OUTPUT_PROVIDER] [--lenient] [--split] [--version]
[--log-stream-stdout] [--log-syslog] [--syslog-device SYSLOG_DEVICE]
[--syslog-facility SYSLOG_FACILITY] [--debug] [--quiet]
[--logging-config LOGGING_CONFIG]
zone source [source ...]
Octo-DNS Dumper
positional arguments:
zone Zone to dump, '*' (single quoted to avoid expansion) for all configured zones
source Source(s) to pull data from
options:
-h, --help show this help message and exit
--config-file CONFIG_FILE
The Manager configuration file to use
--output-dir OUTPUT_DIR
The directory into which the results will be written (Note: will overwrite existing
files)
--output-provider OUTPUT_PROVIDER
The configured provider to use when dumping records. Must support copy() and
directory
--lenient Ignore record validations and do a best effort dump
--split Split the dumped zone into a YAML file per record
--version Print octoDNS version and exit
--log-stream-stdout Log to stdout instead of stderr
--log-syslog Send logging data to syslog in addition to stderr
--syslog-device SYSLOG_DEVICE
Syslog device
--syslog-facility SYSLOG_FACILITY
Syslog facility
--debug Increase verbosity to get details and help track down issues
--quiet Decrease verbosity to show only warnings, errors, and the plan
--logging-config LOGGING_CONFIG
Configure logging with a YAML file, see
https://docs.python.org/3/library/logging.config.html#logging-config-dictschema for
schema details
(octodns_venv) stappers op paddy:~
$
Meer informatie over de Linux
maillijst