holzschu / holzschu/Carnets

importing code from git submodule

Open
#32 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
634
Forks
44
PR merge metrics
No merged PRs in 30d

Description

I checked out a git repo with notebooks.
The structure is something like this

```
ROOT/
submodule/
mymodule.py
notebooks/
mynotebook.ipynb
```

the whole ROOT folder is handed to Carnets by the Working Copy app, and the submodule directory is a git submodule that is checked out (I can see the contents in Carnets)

now if I want to access code from `mymodule.py` in `mynotebook.ipynb` I typically do this like this:

```
sys.path.append("..")
from submodule.mymodule import someClass
```

this works fine on macOS and Linux, but in Carnets I get the error `No module named 'submodule'`

I'm not sure wether this is a limitation of Carnets or of the iOS API that shares this directory structure from Working Copy to Carnets. Either way, is there another way I could achieve this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported ROOT/submodule/notebooks structure with Working Copy and Carnets, starting from the import in mynotebook.ipynb and the mymodule.py location. Investigate how Carnets receives the shared directory and resolves sys.path; done means the import works or the limitation and a supported workaround are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, ios, jupyter-notebook, python
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.