Using Python and R within the same environment
I work with scRNA data and frequently work in both python and R, depending on the packages I want to use. Unfortunately, igraph is the bane of my existence, even though it was supposedly updated to avoid the conflict between python and R. If I start an environment in python with Scanpy and later move to R with MAST and other related packages, I won't able to move back into python and use Scanpy. I have to delete my environment and redownload Scanpy to get the package working. Does anyone know, can I use a conda environment or something similar to keep my R and python packages separate and avoid the igraph conflict? Or is there another way to get around this issue?
Comments
6 comments
Hi Michelle,
Thanks for writing in. We'll take a look at your inquiry and get back to you as soon as we can!
Kind regards,
Jason
Hey Michelle,
Can you provide us with some details to help us in troubleshooting your issue?
Screenshot of your cloud environment configuration (open with gear icon at the top-right of workspace)
What version of scanpy and igraph are you using?
Many thanks,
Jason
Here is my cloud configuration:
I am currently using Scanpy 1.8.1. I am not manually installing igraph for python or R. The default packages that are installed with other software are python-igraph = 0.9.6 and igraph (used in R) = 1.2.6.
If I have R packages installed and try to return to a python notebook, I receive the following error:
import scanpy as sc
This has been an issue for awhile now, and I haven't been able to find a solution online to get R and Python packages to play well with each other. So instead I'm just trying to separate them to avoid the conflict.
Hi Michelle,
Thanks for that information. While our support forum is limited in our ability to support package incompatibility issues, I'm happy to give this a shot to see if I can help find a solution here. Do you have a notebook that you can share that shows the sequence of commands you run to get to this result? If so, can you share the workspace for that notebook with GROUP_FireCloud-Support@firecloud.org and provide a link to the notebook directly so I can take a closer look and try to reproduce the issue?
Kind regards,
Jason
Hi Jason,
So it seems the issue has resolved itself, possibly due to the release of python-igraph 0.9.7. I've been trying to replicate the conflict, and haven't been able to since Thursday. Thanks for taking time to look into this though.
All best,
Michelle
Hey Michelle,
Thank you for reaching out with that update! I'm glad to hear it seems to be working.
If we can help with anything else, please let us know.
Kind regards,
Jason
Please sign in to leave a comment.