average-father-89924
03/28/2023, 12:30 PMsrc/
├─ notebooks/
├─ libraries/
├─ library1/
I would like to access library1
in my notebook. I tried to set source roots but that did not work out for me. Do you have any hints?enough-analyst-54434
03/28/2023, 12:37 PMpants roots
?average-father-89924
03/28/2023, 12:37 PM> pants roots
.
src
enough-analyst-54434
03/28/2023, 12:37 PMsrc
src/libraries
import library1
- correct?average-father-89924
03/28/2023, 12:38 PMimport libraries.library1...
is also fineenough-analyst-54434
03/28/2023, 12:38 PMaverage-father-89924
03/28/2023, 12:39 PMimport libraries.library1
since that mimicks how it works elsewhere in the repo.enough-analyst-54434
03/28/2023, 12:40 PM.
and src
you cannot import libraries.library1
?average-father-89924
03/28/2023, 12:41 PMModuleNotFoundError: No module named 'libraries'
Is the error I am gettingenough-analyst-54434
03/28/2023, 12:41 PMaverage-father-89924
03/28/2023, 12:42 PMpants tailor ::
right?enough-analyst-54434
03/28/2023, 12:42 PMaverage-father-89924
03/28/2023, 12:45 PMpants tailor ::
create any output at all? it does not for me. I might have wrecked it 😮💨enough-analyst-54434
03/28/2023, 12:46 PMaverage-father-89924
03/28/2023, 12:46 PM> pants roots
.
src
> pants tailor ::
>
enough-analyst-54434
03/28/2023, 12:47 PMgit status
should show some BUILD files?tailor
goal creates BUILD
files in various directories - Pants needs these to function.average-father-89924
03/28/2023, 12:48 PMenough-analyst-54434
03/28/2023, 12:48 PMModuleNotFoundError: No module named 'libraries'
- can you provide command line + full output for that?average-father-89924
03/28/2023, 12:49 PM> import libraries
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[3], line 1
----> 1 import libraries
ModuleNotFoundError: No module named 'libraries'
enough-analyst-54434
03/28/2023, 12:50 PMpants run
a notebook or pants package
a PEX that you run or ... ?average-father-89924
03/28/2023, 12:51 PMpants run //src/notebooks/lab.py:python-default_main -- --notebook-dir src/notebooks
enough-analyst-54434
03/28/2023, 12:51 PMpants filedeps --transitive src/notebooks/lab.py
say?average-father-89924
03/28/2023, 12:52 PM> pants filedeps --transitive src/notebooks/lab.py
src/notebooks/BUILD
src/notebooks/lab.py
enough-analyst-54434
03/28/2023, 12:52 PMimport
statements) on libraries - is that correct?average-father-89924
03/28/2023, 12:53 PMenough-analyst-54434
03/28/2023, 12:54 PMfiledeps
output above. Can you share the BUILD?average-father-89924
03/28/2023, 12:54 PMjupyter_lab(name="python-default", requirements=[
"numpy==1.24.2",
"pandas==1.5.3",
"structlog==22.3.0",
"python-dateutil==2.8.2",
"jupyterlab==3.4.8"
])
enough-analyst-54434
03/28/2023, 12:55 PMjupyter_lab
come from?average-father-89924
03/28/2023, 12:55 PMenough-analyst-54434
03/28/2023, 12:55 PMaverage-father-89924
03/28/2023, 12:56 PMenough-analyst-54434
03/28/2023, 12:57 PMrefined-addition-53644
03/28/2023, 1:06 PMaverage-father-89924
03/28/2023, 1:17 PMsrc
folder via import src
.libraries
folder but I since this is outside the folder the BUILD file resides in, it tells me I am not allowed to include it.refined-addition-53644
03/28/2023, 1:26 PMsrc
to your sys.path at the top just before you import these libraries.
I have had issues with importing such local libraries .bored-energy-25252
03/29/2023, 3:59 PM