Python env packages
How to setup a virtual environment?
I have a simple notebook in a
test
folder
I'm on linux, I have marimo installed in the system (not in a virtual environment)
I created a virtual environment in the same directory as the notebook:
But running marimo in the test
folder doesn't seem to see the venv in the test/venv
folder...
I also tried running
Before running marimo but I have the same problem.
The error that I get
Is not very helpful...7 Replies
Did you activate the environment and then install Tensorflow?
You can also manually add to PYTHONPATH, but that's not recommended
Yes, I did. then I opened marimo while inside the environment
What happens when you run:
in a cell?
We have some logic for detecting whether marimo is running in a virtual environment. Looks like it’s not exhaustive.
If you'd like to help or are curious: https://github.com/marimo-team/marimo/blob/main/marimo/_runtime/packages/utils.py#L23-L25
GitHub
marimo/marimo/_runtime/packages/utils.py at main · marimo-team/marimo
A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git. - marimo-team/marimo
I get the current working directory plus:
1: "/usr/bin"
2: "/usr/lib/python312.zip"
3: "/usr/lib/python3.12"
4: "/usr/lib/python3.12/lib-dynload"
5: "/usr/lib/python3.12/site-packages"
Can you also print sys.prefix, sys.real_prefix, and sys.base_prefix?