Skip to content
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

🚸 Improve documentation to avoid problems installing laminr #130

Open
falexwolf opened this issue Jan 7, 2025 · 4 comments
Open

🚸 Improve documentation to avoid problems installing laminr #130

falexwolf opened this issue Jan 7, 2025 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@falexwolf
Copy link
Member

I'm pasting from an internal Slack discussion with @SHerresthal so that you're aware @lazappi & @rcannood and can potentially improve docs & installation process.

The error that Steffi ran into manifested as:

library(laminr)
laminr:::install_lamindb()
Error: Tools for managing Python virtual environments are not installed.
Install venv with:
$ sudo apt-get install python3-venv

This was her Docker

FROM lorenzobonaguro/cycondor:v020
USER root
RUN R -e "install.packages('remotes', repos = 'http://cran.us.r-project.org/')"
RUN R -e "remotes::install_github('laminlabs/laminr', dependencies = TRUE)"
RUN apt-get update && apt-get install -y python3-venv

She installed from GitHub

I installed laminr directly from Github because the installation from CRAN does not have all the functions exported in the Namespace, which gave me an error. But from Github it worked.

The resolution was this:

The problem was that there were different versions of python installed, but when I first installed lamindb into the right environment and then used that environment with laminr:::install_lamindb(new_env = TRUE) , it worked

@falexwolf falexwolf changed the title 🚸 Problems installing laminr 🚸 Improve documentation to avoid problems installing laminr Jan 7, 2025
@falexwolf falexwolf added the documentation Improvements or additions to documentation label Jan 7, 2025
@falexwolf
Copy link
Member Author

Adding the section would also close this issue:

I'd say making a CRAN release and adding these docs improvements are the key priorities for the start of the year.

@lazappi
Copy link
Collaborator

lazappi commented Jan 7, 2025

library(laminr)
laminr:::install_lamindb()
Error: Tools for managing Python virtual environments are not installed.
Install venv with:
$ sudo apt-get install python3-venv

I think this error is because {reticulate} can't find venv. Exactly why this is I'm not sure as it looks like it was installed in your docker.

The problem was that there were different versions of python installed, but when I first installed lamindb into the right environment and then used that environment with laminr:::install_lamindb(new_env = TRUE) , it worked

I'm not quite sure what the solution was here. @SHerresthal could you please explain a bit more what you did to get it working? install_lamindb() should handle creating an environment for you (if it can find venv and/or conda).

@SHerresthal
Copy link

SHerresthal commented Jan 16, 2025

Hi!

This is how I got the error:

docker run --rm --entrypoint bash --platform linux/amd64 -ti lorenzobonaguro/cycondor:v020
R
remotes::install_github('laminlabs/laminr', dependencies = TRUE)
laminr:::install_lamindb()

Then this error appears:

Error: Tools for managing Python virtual environments are not installed.

Install venv with:
$ sudo apt-get install python3-venv

I ran sudo apt-get install python3-venv, but that did not change the error.

The way I solved it was to first run which python to check the python version is used, then ran python -m pip install virtualenv, to be able to install a virtual environment.

Then I ran in R the following:

remotes::install_github('laminlabs/laminr', dependencies = TRUE)
library('reticulate')
py_install(packages = c("lamindb","ipython"), envname = "r-lamindb", python = virtualenv_starter('/opt/conda/bin/python'))
use_virtualenv(virtualenv = "r-lamindb", required = TRUE)
library(laminr)
laminr:::install_lamindb(new_env = FALSE)

So I used reticulate first to install a virtual environment called r-lamindb, like the install_lamindb function would have done it, and then used this existing environment for install_lamindb(new_env = FALSE) .

(Sorry, I realized I previously wrote to Alex that I used install_lamindb(new_env = TRUE), but it was the other way around).
Hope this description made the error clearer.

@lazappi
Copy link
Collaborator

lazappi commented Jan 28, 2025

@SHerresthal and I discussed this and she found a solution that worked in this case but it's a bit hard to generalise and it depends what it installed in the container etc. There have been some updates to the documentation in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants