Closed jl-calda closed 11 months ago
Hi @jl-calda,
Please try to add to notebook
import sys
print(sys.path)
Do you have the same output in vs code and mercury?
Hi @pplonski
They are not same as shown below.
From Mercury
['/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury/apps/..', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury/apps/..', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury/apps/nbworker', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python310.zip', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/lib-dynload', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages']
From VS Code ['/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury', '/Users/jlcalda/Documents/jupyter notebooks/mercury', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python310.zip', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/lib-dynload', '', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages']
Please add missing path to sys.path before importing module. Example:
import sys
sys.path.append("path_to_my_module")
import my_module
Thanks. Read how python does import. Figured it out now.
Hi @jl-calda,
Please try to add to notebook
import sys print(sys.path)
Do you have the same output in vs code and mercury?
What does it mean to run this in mercury?
It is just to check your paths in the notebook in Mercury.
It is just to check your paths in the notebook in Mercury.
Can you please explain in more detail? step-by-step please. I couldn't see a terminal in mercury.
Sure, user has problem with module import, and I suggested to check imported packages by printing sys.path
. Do you have problem with package import in Mercury notebook? What is your issue? Maybe it will be good idea to create new github issue?
Sure, user has problem with module import, and I suggested to check imported packages by printing
sys.path
. Do you have problem with package import in Mercury notebook? What is your issue? Maybe it will be good idea to create new github issue?
I can't understand what mercury notebook means? and how do I write code there. As of now I only see a webapp open by mercury.
The mercury notebook is a notebook opened by mercury. It is a web app. You need to develop notebook in Jupyter Lab. If you have Python notebook ready, then you can serve it as web app.
Hi @pplonski
They are not same as shown below.
From Mercury
['/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury/apps/..', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury/apps/..', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury/apps/nbworker', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python310.zip', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/lib-dynload', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages']
From VS Code ['/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages/mercury', '/Users/jlcalda/Documents/jupyter notebooks/mercury', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python310.zip', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/lib-dynload', '', '/Users/jlcalda/Documents/jupyter notebooks/.conda/lib/python3.10/site-packages']
Then how do I get this output from mercury, I can get this from VScode (jupyter in VScode) already
Hi @Yugal0,
Probably you are using different kernel / environment in VS Code and in Mercury. Please double check if you are using the same environment.
Would like some clarity about the following.
Below is my file structure
It is working on VSCode
But when running mercury it can't find my constants import
Thanks