scenicplus icon indicating copy to clipboard operation
scenicplus copied to clipboard

ModuleNotFoundError: No module named 'pyranges.pyranges_main'

Open janursa opened this issue 10 months ago • 10 comments

I have results of scenicplus using the previous version with 'scplus_obj.pkl' as output. I installed the new version recently and have problem reading this file. dill.load gives error ModuleNotFoundError: No module named 'pyranges.pyranges_main'. Based on some search, if i pip install pyranges==0.0.129, it fixes this error and read the file successfully. However, it conflicts with other packages ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pycistopic 2.0a0 requires pyranges<0.0.128, but you have pyranges 0.0.129 which is incompatible. pycistarget 1.0a2 requires pyranges<0.0.112,>=0.0.111, but you have pyranges 0.0.129 which is incompatible. scenicplus 1.0a1 requires pyranges==0.0.111, but you have pyranges 0.0.129 which is incompatible..

which results in scenic_obj not having the right content, e.g. missing eRegulon etc.

janursa avatar Apr 25 '24 12:04 janursa

Hi @janursa

Indeed, like you said, this error is caused by saving the object using a different version of pyranges than the one you are using to load the object.

I would not worry too much about this warning:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pycistopic 2.0a0 requires pyranges<0.0.128, but you have pyranges 0.0.129 which is incompatible. pycistarget 1.0a2 requires pyranges<0.0.112,>=0.0.111, but you have pyranges 0.0.129 which is incompatible. scenicplus 1.0a1 requires pyranges==0.0.111, but you have pyranges 0.0.129 which is incompatible.

Did it still install pyranges v0.0.129?


import pyranges
pyranges.__version__

Also, do you still have an environment with the previous version of SCENIC+? When you load the object with that environment, are you also missing those fields in the scplus_obj?

Best,

Seppe

SeppeDeWinter avatar Apr 29 '24 15:04 SeppeDeWinter

Thanks, @SeppeDeWinter, By installing v0.0.129, it reads the file without an error but the content is missing. Unfortunately, i dont have an environment with the previous version of SCENIC+. But, it has all the content as i had already extracted eRegulons. Also, it has 15GB of size so i cannot be empty. It seems that something goes wrong in the reading process. best Jalil

janursa avatar May 01 '24 18:05 janursa

Hi

Very strange! This is exactly the reason why we switched away from using pickle. The only thing I can try to suggest is to try to rebuild the environment, I'm sorry I can not be of much help here.

Best,

Seppe

SeppeDeWinter avatar May 02 '24 10:05 SeppeDeWinter

thank you, @SeppeDeWinter can you pls direct me to a branch or a commit of the github repo that was for the past version of scenicplus? thanks

janursa avatar May 02 '24 14:05 janursa

Hi @janursa

Of course, this code can be found here: https://github.com/aertslab/scenicplus/tree/old.

Best,

Seppe

SeppeDeWinter avatar May 02 '24 14:05 SeppeDeWinter

thank you, @SeppeDeWinter, I tried to install the old version but seems like in your requirements.txt, you are installing certain packages using git, pointing to the master/main branches. This gives an error as certain branches are no longer existing or compatible. Would you be kind to check if you can install the old version of scenicplus yourself? appreciated :-)

Collecting pycistarget@ git+https://github.com/aertslab/pycistarget@master (from scenicplus==1.0.1.dev13+gc64b26a) Cloning https://github.com/aertslab/pycistarget (to revision master) to /tmp/pip-install-zrnfgwth/pycistarget_54b1d25f5ec74f88b3f965f9a4594a30 Running command git clone --filter=blob:none --quiet https://github.com/aertslab/pycistarget /tmp/pip-install-zrnfgwth/pycistarget_54b1d25f5ec74f88b3f965f9a4594a30 WARNING: Did not find branch or tag 'master', assuming revision or ref. Running command git checkout -q master error: pathspec 'master' did not match any file(s) known to git error: subprocess-exited-with-error

janursa avatar May 03 '24 08:05 janursa

Hi @janursa

I fixed the version in the old branch: https://github.com/aertslab/scenicplus/commit/c1924d7b03ca80b7bea3215e204e12bc1dca3124.

Creating a new environment from this


mamba create --name scenicplus_old python=3.8 -y
mamba activate scenicplus_old
git clone https://www.github.com/aertslab/scenicplus
cd scenicplus
git checkout old
pip install .

Works in my hands and I'm also able to load old scplus_obj files.

Best,

Seppe

SeppeDeWinter avatar May 07 '24 11:05 SeppeDeWinter

thank you @SeppeDeWinter, That installed the package successfully. But, the original issue is still there. when i load the data, i get ModuleNotFoundError: No module named 'pyranges.pyranges_main. i tried this both on my personal computer as well as linux cluster and same results. which version of pyranges did you use that let you load the old scplus_obj?

janursa avatar May 07 '24 12:05 janursa

Hi @janursa

I used the version listed in the requirements file (i.e. 0.0.111). But it also depends which version you used to generate your object.

All the best,

Seppe

SeppeDeWinter avatar May 15 '24 07:05 SeppeDeWinter

Hi I got the same problem after setting up a new ENV and I fixed the loading problem with dill by updating to 0.0.129.

Although I expect some problems with the other toolkits when rerunning the analysis:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pycistopic 2.0a0 requires pyranges<0.0.128, but you have pyranges 0.0.129 which is incompatible. scenicplus 1.0a1 requires pyranges==0.0.111, but you have pyranges 0.0.129 which is incompatible. pycistarget 1.0a2 requires pyranges<0.0.112,>=0.0.111, but you have pyranges 0.0.129 which is incompatible.

redvoidling avatar Jul 12 '24 16:07 redvoidling