-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup jupyter notebook root folder #2044
Labels
Comments
prudhomm
changed the title
setup jupyter notebook root folter
setup jupyter notebook root folder
Feb 28, 2023
I have a solution to propose that does not directly involve vscode but rather cmake and the presets. import sys,os
dev_mode=True
preset='python'
if dev_mode and os.path.exists(f'../../build/{preset}/install/lib/python3/dist-packages'):
sys.path.insert(0,os.path.abspath(f'../../build/{preset}/install/lib/python3/dist-packages'))
print(sys.path) it is the choice of the user to select the dev_node or the preset. |
5 tasks
5 tasks
prudhomm
added a commit
that referenced
this issue
Mar 12, 2023
…-folder resolves #2044: setup jupyter notebook
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure this line should stay here : if the preset selected is not
python
there is no reason this path should be correct.The advantage of this setting it that when we run a notebook in vscode, it automatically find the development packages installed in
build
directory, so there is no need to set by hand$PYTHONPATH
.The drawback is that when we launch a kernel, the working directory is no longer the directory where the ipynb file is saved, it is the one set in this line. So it is messy to load the config file (for example in python/pyfeelpp-mor/feelpp/mor/nirb/test_nirb_offline.ipynb, the path is hard coded to a local path
"/home/saigre/Documents/code/feelpp/python/pyfeelpp-mor/feelpp/mor/nirb/model/square/square.cfg"
which should have not been pushed, my bad !)see eg:
I don't know what would be the best way to set the environment easily : automatically set
PYTHONPATH
to the install directory, while the working directory still being the one where the notebook file is saved...Originally posted by @thomas-saigre in #1944 (comment)
The text was updated successfully, but these errors were encountered: