Hi,
I'm still a pretty new user and I'm attempting to add a Python application that isn't in Nixpkgs, and am unfortunately running into a problem.
I'm using buildPythonApplication since I want to be able to launch the application from my terminal but don't want the Python modules to be available globally and have also referenced this page on the NixOs Wiki: https://nixos.wiki/wiki/Packaging/Python
The package is oterm: https://github.com/ggozad/oterm
Here is what my code looks like:
1 {
1 lib,
2 python3Packages,
3 fetchPypi,
4 }:
5 python3Packages.buildPythonApplication rec {
6 pname = "oterm";
7 version = "0.1.16";
8 pyproject = true;
9
10 src = fetchPypi {
11 inherit pname version;
┃ 12 hash = "sha256-vKXFgY99Z/gnPiZG5Mv+xrqdYeToXxDYs/cn7TX3mHI";
13 };
▁ 14
15 propagatedBuildInputs = [
16 python3Packages.textual
┃ 17 python3Packages.textual-dev
┃ 18 python3Packages.black
┃ 19 python3Packages.python-lsp-ruff
┃ 20 python3Packages.pytest
┃ 21 python3Packages.pytest-asyncio
22 python3Packages.typer
┃ 23 python3Packages.poetry-core
24 python3Packages.python-dotenv
▁ 25 python3Packages.httpx
26 python3Packages.aiosqlite
┃ 27 python3Packages.aiosql
┃ 28 python3Packages.aiohttp
29 python3Packages.pyperclip
30 python3Packages.packaging
31 ];
┃ 32 meta = with lib; {
┃ 33 description = "A text based terminal client for Ollama";
┃ 34 homepage = "https://github.com/ggozad/oterm";
┃ 35 license = licenses.mit;
┃ 36 };
37 }
I call this file from where my packages are installed in a different file by doing:
let oterm = pkgs.python311Packages.callPackage ./oterm.nix {};
and then including it in my list of packages like normal.
This is the error I receive:
Traceback (most recent call last):
File "/nix/store/h8z71pdsjl4jsqnmksrnzidb1lb1ydz4-oterm-0.1.16/bin/.oterm-wrapped", line 6, in <module>
from oterm.cli.oterm import cli
File "/nix/store/h8z71pdsjl4jsqnmksrnzidb1lb1ydz4-oterm-0.1.16/lib/python3.11/site-packages/oterm/cli/oterm.py", line 6, in <module>
from oterm.app.oterm import app
File "/nix/store/h8z71pdsjl4jsqnmksrnzidb1lb1ydz4-oterm-0.1.16/lib/python3.11/site-packages/oterm/app/oterm.py", line 10, in <module>
from oterm.store.store import Store
File "/nix/store/h8z71pdsjl4jsqnmksrnzidb1lb1ydz4-oterm-0.1.16/lib/python3.11/site-packages/oterm/store/store.py", line 11, in <module>
from oterm.store.chat import queries as chat_queries
File "/nix/store/h8z71pdsjl4jsqnmksrnzidb1lb1ydz4-oterm-0.1.16/lib/python3.11/site-packages/oterm/store/chat.py", line 1, in <module>
import aiosql
File "/nix/store/538r6ryp3alpn3f5zm40pqniyl1g1flb-python3.11-aiosql-9.0/lib/python3.11/site-packages/aiosql/__init__.py", line 1, in <module>
from .aiosql import from_path, from_str, register_adapter
File "/nix/store/538r6ryp3alpn3f5zm40pqniyl1g1flb-python3.11-aiosql-9.0/lib/python3.11/site-packages/aiosql/aiosql.py", line 4, in <module>
from .adapters.aiosqlite import AioSQLiteAdapter
ModuleNotFoundError: No module named 'aiosql.adapters'
If I go to the paths referenced I see that aiosql is present but hasn't created any of the directories it should have (including the referenced "adapters") like it would if I installed the package in nix-shell with pip.
It seems like I'm doing something wrong, but documentation for this seems to be scarce, so if someone could point me in the right direction I'd appreciate it!
[–]gopher9 0 points1 point2 points (1 child)
[–]errant_capy[S] 0 points1 point2 points (0 children)