-
Sorry to ask what might be a silly question, but I'm encountering a namespace resolution issue in my Basilisp project. My project structure is: src/prob-l/ In core.lpy: (ns prob-l.core) In model.lpy: (ns prob-l.model
:require [prob-l.core]) The error shows "namespace not found" when trying to require prob-l.core in model.lpy. Am I missing something in the project setup or namespace declaration? I'm developing a probabilistic programming language based on JAX using Basilisp. Looking forward to sharing it with the community when ready! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @wjke-nics, this issue likely arises from using a hyphen in
Additionally, since your code is in Managing additional source locations is thus delegated to the Python build too being used to develop the application. For example, with the Poetry tool, you can use the the # create new project with a `src` directory, which will be added to the `sys.path` after activating the environment
> poetry new prob-l --src
# add Basilisp as a dependency
> poetry add basilisp
# install project so that is available within the virtual environment
prob-l> poetry install
# activate the virtual environment
> poetry shell
(prob-l-py3.11) PS prob-l> basilisp repl
basilisp.user=> I hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi @wjke-nics,
this issue likely arises from using a hyphen in
src/prob-l/
instead ofsrc/prob_l
. Please refer to the the Runtime/Namespace section in the documentation:Additionally, since your code is in
src/
, which isn't included in Pythonsys.path
by default, you'd need to include it in thens
declaration, e.g.,(ns src.prob-l.model ...)
, even though this is not probably what you want to do. There is a feature request to specify project source locations, but it's part of broader CLI tools task that is sti…