Hi!
I’m trying to develop a python application and package it with nix flakes.
However, I’m having some troubles with importing custom python module.
This is my repo:
commit id c836b50 is from before importing module; as you can see I can run my application:
user@kaktus ~ ((c836b509))> nix run .#fuujin
language = en
debug level = 1
user@kaktus ~ ((c836b509))>
However, after adding these lines:
from fuujin_lib.functions import logger
logger(debug_level=debug_level)
(This is my repo structure:
user@kaktus ~ (main)> tree
.
├── docs
│ └── main.md
├── flake.lock
├── flake.nix
├── fuujin
│ ├── fuujin_lib
│ │ ├── functions.py
│ │ └── __pycache__
│ │ └── functions.cpython-311.pyc
│ ├── __init__.py
│ ├── __main__.py
│ ├── master.py
│ └── __pycache__
│ ├── fnlib.cpython-311.pyc
│ └── master.cpython-311.pyc
├── fuujin.code-workspace
├── LICENSE
├── poetry.lock
├── pyproject.toml
├── README.md
├── result -> /nix/store/rfidgilh6kbyh6hnfaa4wpgz84v1c5mh-fuujin-0.1.0
└── TODO.md
7 directories, 16 files
user@kaktus ~ (main)>
I get the following error:
user@kaktus ~ (main)> nix run .#fuujin
Traceback (most recent call last):
File "/nix/store/s2222cjfpvvx5l9i5dg1s08f7ck8d4lg-fuujin-0.1.0/bin/.fuujin-wrapped", line 9, in <module>
sys.exit(main())
~~~~^^
File "/nix/store/s2222cjfpvvx5l9i5dg1s08f7ck8d4lg-fuujin-0.1.0/lib/python3.13/site-packages/fuujin/master.py", line 27, in main
from fuujin_lib.functions import logger
ModuleNotFoundError: No module named 'fuujin_lib'
user@kaktus ~ (main) [1]>
My guess is that it has something to do with entry point in pyproject.toml. Am I right? Can you guys help me out?
Best,
Miro