PoonLab / OpenRDP

An open-source re-implementation of the RDP4 recombination detection program
GNU General Public License v3.0
45 stars 9 forks source link

Error running openrdp #89

Closed PaulaPrietoOliveira closed 1 week ago

PaulaPrietoOliveira commented 1 month ago

Dear Sir or Madam,

I hope you are well.

I'm having trouble running Openrdp on my MacBook. I can't run BootScam. I am attaching the error that I found when I run the command openrdp -c default.ini -m bootscan -q short.fasta. The file is called bootscan.error.txt.

Details that may help: I'm using macOS Sonoma 14.4.1 (23E224) My Python version is Python 3.10.13 I got OpenRDP from GitHub with git clone https://github.com/PoonLab/OpenRDP I installed OpenRDP by following README.md with sudo python3 setup.py install

Thank you for your attention.

Best regards, Paula Prieto Oliveira

bootscan.error.txt

deve105 commented 1 month ago

Hi there, I got the same error. But I did use instead

python3 -m pip install .

DE

ArtPoon commented 1 month ago

Hi @PaulaPrietoOliveira and @deve105 - sorry for the delay in responding to this issue. I did have a look through the error log that you provided. There are two exceptions:

ImportError: cannot import name 'Sequence' from 'collections' (/Users/_____/anaconda3/lib/python3.10/collections/__init__.py)

and:

  File "/Users/_____/anaconda3/lib/python3.10/site-packages/numpy/__init__.py", line 135, in <module>
    raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.
    raise ImportError(msg) from e

Can you please provide the version number for your local installs of NumPy and Anaconda?

ArtPoon commented 1 month ago

@PaulaPrietoOliveira what happens if you try a user-level install with python3 setup.py install --user? Might be version discordance between whatever is loaded by superuser and your local installs of package dependencies.

ArtPoon commented 1 month ago

I was not able to reproduce this error on desktop running macOS Sonoma 14.3.1 with Python 3.11.5:

(venv) art@Wernstrom OpenRDP % openrdp -c openrdp/default.ini -m bootscan -q tests/short.fasta
/Users/art/venv/bin/openrdp:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('OpenRDP==0.1.0', 'openrdp')
Invalid option for 'window_size'.
Using default value (200) instead.

Method      Start   End Recombinant Parent1 Parent2 Pvalue
------------------------------------------------------------------------

(venv) art@Wernstrom OpenRDP % 
ArtPoon commented 1 month ago

Turns out this system is just filthy with Python installs. Based on what I could find browsing the web for related problems, I tried calling the above import statement from System Python:

(venv) art@Wernstrom OpenRDP % /usr/bin/python3 -V
Python 3.9.6
(venv) art@Wernstrom OpenRDP % /usr/bin/python3 -c "from collections import Sequence"
<string>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

I also have 3.10 and 3.11 under /usr/local/bin:

(venv) art@Wernstrom OpenRDP % /usr/local/bin/python3.10 -c "from collections import Sequence"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'Sequence' from 'collections' (/usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
(venv) art@Wernstrom OpenRDP % /usr/local/bin/python3.11 -c "from collections import Sequence"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'Sequence' from 'collections' (/usr/local/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/collections/__init__.py)

Of course, this makes me question how I was able to run this with 3.11 (my venv install) without throwing this ImportError

ArtPoon commented 1 month ago

Hm, we're not even calling this import - this is a NumPy thing. Getting your NumPy version number will be helpful:

(venv) art@Wernstrom OpenRDP % python
Python 3.11.5 (main, Aug 24 2023, 15:18:16) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.26.0'
PaulaPrietoOliveira commented 1 month ago

I am running the openrdp using docker and now it is working well. Thank you!

Paula Prieto Oliveira, Ph.D. UNC Charlotte, CCI, Dept. of Bioinformatics and Genomics CIPHER center https://cipher.charlotte.edu/ | phyloinformatics.com

On Fri, May 10, 2024 at 6:10 PM Art Poon @.***> wrote:

[Caution: Email from External Sender. Do not click or open links or attachments unless you know this sender.]

Hm, we're not even calling this import - this is a NumPy thing. Getting your NumPy version number will be helpful:

(venv) @.*** OpenRDP % pythonPython 3.11.5 (main, Aug 24 2023, 15:18:16) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import numpy>>> numpy.version '1.26.0'

— Reply to this email directly, view it on GitHub https://github.com/PoonLab/OpenRDP/issues/89#issuecomment-2105330794, or unsubscribe https://github.com/notifications/unsubscribe-auth/BB7LBJB6TQ6FOMLE4XGUWJDZBVAWJAVCNFSM6AAAAABHLQLYM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGMZTANZZGQ . You are receiving this because you were mentioned.Message ID: @.***>

ArtPoon commented 1 month ago

Glad to hear that you got things working @PaulaPrietoOliveira. However it would be really helpful if you could provide the version numbers of NumPy and pathlib that you were trying to run in your anaconda instance, so we can resolve this issue.

PaulaPrietoOliveira commented 1 month ago

My numpy version is

'1.24.3'

Paula Prieto Oliveira, Ph.D. UNC Charlotte, CCI, Dept. of Bioinformatics and Genomics CIPHER center https://cipher.charlotte.edu/ | phyloinformatics.com

On Tue, May 14, 2024 at 10:02 AM Art Poon @.***> wrote:

[Caution: Email from External Sender. Do not click or open links or attachments unless you know this sender.]

Glad to hear that you got things working @PaulaPrietoOliveira https://github.com/PaulaPrietoOliveira. However it would be really helpful if you could provide the version numbers of NumPy and pathlib that you were trying to run in your anaconda instance, so we can resolve this issue.

— Reply to this email directly, view it on GitHub https://github.com/PoonLab/OpenRDP/issues/89#issuecomment-2110326848, or unsubscribe https://github.com/notifications/unsubscribe-auth/BB7LBJC3N7IN42HFKBDAO2LZCIKN7AVCNFSM6AAAAABHLQLYM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQGMZDMOBUHA . You are receiving this because you were mentioned.Message ID: @.***>

ArtPoon commented 1 month ago

Thanks @PaulaPrietoOliveira - can I also trouble you for your pathlib version as well?

PaulaPrietoOliveira commented 1 month ago

My pathlib version is

3.11.5

Paula Prieto Oliveira, Ph.D. UNC Charlotte, CCI, Dept. of Bioinformatics and Genomics CIPHER center https://cipher.charlotte.edu/ | phyloinformatics.com

On Tue, May 21, 2024 at 10:03 AM Art Poon @.***> wrote:

[Caution: Email from External Sender. Do not click or open links or attachments unless you know this sender.]

Thanks @PaulaPrietoOliveira https://github.com/PaulaPrietoOliveira - can I also trouble you for your pathlib version as well?

— Reply to this email directly, view it on GitHub https://github.com/PoonLab/OpenRDP/issues/89#issuecomment-2122714851, or unsubscribe https://github.com/notifications/unsubscribe-auth/BB7LBJBOMPGVAVA5XJRTC5TZDNH3FAVCNFSM6AAAAABHLQLYM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSG4YTIOBVGE . You are receiving this because you were mentioned.Message ID: @.***>

ArtPoon commented 4 weeks ago

@GopiGugan to create a venv with these versions to attempt a repro

GopiGugan commented 3 weeks ago

I wasn't able to reproduce this issue in a virtual environment:

[gopigugan] openrdp -c openrdp/default.ini -m bootscan -q tests/short.fasta                                                                                   
openrdp/bin/openrdp:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('OpenRDP==0.1.0', 'openrdp')
Invalid option for 'window_size'.
Using default value (200) instead.

Method      Start   End Recombinant Parent1 Parent2 Pvalue
------------------------------------------------------------------------

[gopigugan] python3                                                                                                                                           
Python 3.10.13 | (main, Dec 23 2023, 15:35:25) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.24.3'

@PaulaPrietoOliveira - if possible, can you please activate your conda environment, run the following command: conda env export > environment.yml and share the generated environment.yml file? This way we can replicate your environment and try reproducing this issue.