-
Notifications
You must be signed in to change notification settings - Fork 326
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
Error in normalizePath #1460
Comments
Thanks for reporting! To track this down we'll need to figure out what's wrong.
rlang::global_entrace()
reticulate::py_discover_config()
rlang::last_error() |
I do not have mamba installed. I had it at some point, but uninstalled it at some point (I switched to the new libmamba dependency solver). These are the commands you asked for:
And session info:
|
It would appear that mamba is not completely uninstalled - there is at least the symlink at Can you try removing it and see if that fixes the issue? |
I think we make |
/path/miniconda3/bin/mamba does not exist (either symlink or real file), so cannot be removed.
I am not sure how I installed mamba. I believe it was |
And how was conda installed? The |
Sorry for the confusion. I was just simplifying my home directory ( I don't remember the exact installation. It was with the Miniconda3 installer. |
I tried but am unable to reproduce the error. Would you be able to step through |
I did not know about the I got to line 105. In case the numbering is different, here are lines 103-106:
Running in code browser:
Modifying the code to generate output:
So the error is from
Then
Then
Then debugging
This is the code I see:
|
Thanks for the detailed investigation! It looks like You can confirm the above is correct by checking: readLines("~/miniconda3/envs/r-reticulate/conda-meta/history") and noting a line like
My recomendation is to recreate the conda_remove("r-reticulate")
conda_create("r-reticulate") virtualenv_create("r-reticulate", force = TRUE) |
That indeed seems to be the case. Recreating the environment resolved the problem. Maybe there should be a check if the binary in history still exists. Why not just check if |
It's common for users to have multiple conda installations on their system, and also, for the relative locations of the conda executable and conda environments to be customized. Parsing the history file has been to-date the most robust way to find the correct conda executable for a particular conda environment. |
For anyone using a biocontainer (or some kind of Docker container built from a conda environment, but does not actually contain conda, but still has residual conda files, e.g. /usr/local/conda-meta/history): You can get around it by masking the conda detection function:
It would be nice if this could be set via environment variable. e.g. |
@mtekman Looking at the base biocontainer image, I see the conda binary is provided: https://github.com/BioContainers/containers/blob/master/biocontainers/1.2.0/Dockerfile Can you give an example of a conda environment where the conda binary that created the env is no longer available? How do you do the equivalent of |
@t-kalinowski The best I can do is give you same environment I was working with, but it's long and convoluted: ## Install Planemo
python3 -m venv planemo
. planemo/bin/activate
pip install planemo
## Clone tools-iuc
git clone https://github.com/galaxyproject/tools-iuc
cd tools-iuc/tools/sceasy
## Enable docker and build a biocontainer from the sceasy recipe
sudo systemctl start docker
## conda should also be auto-installed at this step, but if not, install micromamba
planemo test --biocontainers sceasy.xml --no-cleanup ## persist the containers The full docker command should be printed somewhere in the wall of text you see when running planemo, but just in case you can't find it:
let's assume the environment is called: "mulled-v2-c123456" then there should be a docker image of that same name created on your machine, which you can debug via
at this point you're in the environment and can test
I think for this particular container, it will not fail because of the overrides that I put into the sceasy.xml recipe. Disable the override, and run planemo test again, and it should build you a container that has the problematic conda install Hope that helps! Related: galaxyproject/tools-iuc#5519 |
I found this fix here. I know it doesn't fix the root cause, but perhaps it's a temporary solution until it is solved: assignInNamespace("is_conda_python", function(x){ return(FALSE) }, ns="reticulate") |
@ollieeknight if you scroll up, you can see that we're in the very thread you're linking to :D |
wow, that's embarrassing 😅 I spent so long trying to fix this yesterday on the cluster than I'm working on that I think it fried my brain. apologies! |
hah, I have been there! |
@t-kalinowski There is no conda binary in the environment, so I don't think the fix would actually work. Conda was used to populate the Docker image system libraries (prefix: All that exists inside the container is a bunch of JSON files at the I want to share the docker container I have with you but it's 2.9GB file and there is no accompanying Dockerfile that I can find that would reproduce the container exactly. The instructions I used above will generate the Docker image I have though |
One telling sign I can see between a regular conda installation, and one generated by this container is that the In a regular conda installation there is: > cat ~/micromamba/conda-meta/history | head -1
# cmd: /home/user/.local/bin/micromamba install \
# -c bioconda -c conda-forge bioconductor-biostrings whereas one in the container would yield: > cat /usr/local/conda-meta/history | head -1
# cmd: /opt/conda/bin/mamba install \
# -c conda-forge -c bioconda bioconductor-biostrings \
# --strict-channel-priority -p /usr/local --copy --yes --quiet Though, I can see that this isn't a silver bullet for whether or not a biocontainer contains conda or not... |
After installing reticulate, I see the following error when R launches (curiously, in RStudio, but not command-line R):
I also see a similar error with various reticulate commands:
In case it helps, other conda-related functions seem to work:
This sounds very similar to previous issues #1176 and #1375 but those were resolved months ago. I am using the latest CRAN version 1.31.
The text was updated successfully, but these errors were encountered: