Bug
ant dev example <name> -l python shells out to python3 from the user's PATH rather than sys.executable (the interpreter that's running ant-dev itself). On Ubuntu 24.04 — where PEP 668 makes a system-wide pip install -e ant-dev/ impossible — ant-dev lives in a venv. The venv's python3 has antd installed; the system python3 does not. So unless the user has manually activated the venv, the example fails:
$ ant dev example data -l python
Traceback (most recent call last):
File "/home/nic/Projects/ant-sdk/antd-py/examples/02_data.py", line 6, in <module>
from antd import AntdClient
ModuleNotFoundError: No module named 'antd'
Location
ant-dev/src/ant_dev/cmd_example.py:69-71:
# Use 'python' on Windows, 'python3' on Unix
python = "python" if sys.platform == "win32" else "python3"
result = subprocess.run([python, str(script)])
Fix
Use sys.executable — it always points at the interpreter running ant-dev, which by construction has access to the same dependency tree (since ant-dev depends on antd[rest]):
result = subprocess.run([sys.executable, str(script)])
This also removes the Windows special-case.
Environment
- Ubuntu 24.04.4 LTS in an Incus LXC
ant-dev installed via python3 -m venv ~/.venvs/ant-dev && pip install -e antd-py[rest] && pip install -e ant-dev (PEP 668 blocks system-wide install)
Workaround in the meantime: . ~/.venvs/ant-dev/bin/activate before ant dev example ….
Bug
ant dev example <name> -l pythonshells out topython3from the user's PATH rather thansys.executable(the interpreter that's runningant-devitself). On Ubuntu 24.04 — where PEP 668 makes a system-widepip install -e ant-dev/impossible —ant-devlives in a venv. The venv'spython3hasantdinstalled; the systempython3does not. So unless the user has manually activated the venv, the example fails:Location
ant-dev/src/ant_dev/cmd_example.py:69-71:Fix
Use
sys.executable— it always points at the interpreter runningant-dev, which by construction has access to the same dependency tree (sinceant-devdepends onantd[rest]):This also removes the Windows special-case.
Environment
ant-devinstalled viapython3 -m venv ~/.venvs/ant-dev && pip install -e antd-py[rest] && pip install -e ant-dev(PEP 668 blocks system-wide install)Workaround in the meantime:
. ~/.venvs/ant-dev/bin/activatebeforeant dev example ….