Coder Social home page Coder Social logo

Comments (6)

robert-elles avatar robert-elles commented on June 15, 2024 1

Hi,

I was able to find the cause of this. In mercury.py celery is started using subprocess.popen. This somehow starts celery with some other python interpreter, not the one that had my editable package installed.

I also saw that the notebook cells are executed using the execnb package. I am not sure if execnb will take the interpreter from the kernel.json to execute the code cells.

Pull request 395 solves my issue.

from mercury.

pplonski avatar pplonski commented on June 15, 2024

Hi @robert-elles,

My workflow is as follow:

  1. Create a virtual env and activate it.
  2. Add virtual env as a kernel to Jupyter. I'm doing it with command python -m ipykernel install --user --name my_env
  3. Start mercury server in the current terminal, mercury should use the current virtual env.

Please let me know if it works for you.

from mercury.

robert-elles avatar robert-elles commented on June 15, 2024

Hi,

thanks but it didn't help. Somehow it keeps using the jupyter from my global system python installation and not the local one.

from mercury.

pplonski avatar pplonski commented on June 15, 2024

Hi @robert-elles,

Could you please provide me a screenshot from your terminal when you run mercury? Please also try to run the command python -c "import sys; print(sys.path)" to check your environment paths.

from mercury.

robert-elles avatar robert-elles commented on June 15, 2024

I found out the import error is only about packages that are installed in editable mode. So it actually is using the local jupyter install but it cannot import packages from the same project that are editable packages.

If I run jupyter nbconvert --execute ./notebook.ipynb --to html --no-input it works and everything can be imported. But running merucry run from the same terminal and folder leads to the import error.

When I run python -c "import sys; print(sys.path)" the path of the library I want to import is there.

from mercury.

pplonski avatar pplonski commented on June 15, 2024

I've just merged #395 - thank you!

from mercury.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.