kcleal / pywfa

Python wrapper for wavefront alignment using WFA2-lib
MIT License
35 stars 2 forks source link

Import Error on M1 Mac Python 3.10 #6

Closed KyleStiers closed 1 year ago

KyleStiers commented 1 year ago

Hello, I'm getting an import error similar to the other one reported here - but different enough that I'll make it a separate issue.

After pip install pywfa

>>> from pywfa.align import WavefrontAligner
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/miniconda/base/envs/py-3.10/lib/python3.10/site-packages/pywfa/__init__.py", line 2, in <module>
    from .align import WavefrontAligner, clip_cigartuples, cigartuples_to_str, elide_mismatches_from_cigar
ImportError: dlopen(/opt/homebrew/Caskroom/miniconda/base/envs/py-3.10/lib/python3.10/site-packages/pywfa/align.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (_cigar_print_pretty)
>>>
kcleal commented 1 year ago

Hi @KyleStiers, are you able to try the conda install route?

kcleal commented 1 year ago

Alternatively, it may work by cloning the repo and using python setup.py install.

KyleStiers commented 1 year ago

Hi @KyleStiers, are you able to try the conda install route?

I did try the conda route, and haven't gotten that to work either unfortunately. Working to solve that part though as it seems to be an issue on my end due to proxies.

Alternatively, it may work by cloning the repo and using python setup.py install.

I also tried this and get errors regarding the path it expects (from distutils it appears) for clang, but haven't had luck forcing it quite yet.

KyleStiers commented 1 year ago

Tried conda install and pip install on WSL2 with python 3.11 as well just out of curiosity... both say they worked but:

pip:

>>> import pywfa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/redacted/miniconda3/envs/py-3.11/lib/python3.11/site-packages/pywfa/__init__.py", line 2, in <module>
    from .align import WavefrontAligner, clip_cigartuples, cigartuples_to_str, elide_mismatches_from_cigar
ImportError: /home/redacted/miniconda3/envs/py-3.11/lib/python3.11/site-packages/pywfa/align.cpython-311-x86_64-linux-gnu.so: undefined symbol: wavefront_align
>>>

Conda says it successfully installs on linux but:

>>> from pywfa.align import WavefrontAligner
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pywfa'

What version of python was this written/tested with?

kcleal commented 1 year ago

Ok thanks for trying with this. I can have a go on an M1 later in the week and report back. Sorry about the error

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Kyle Stiers @.> Sent: Tuesday, March 28, 2023 10:33:20 PM To: kcleal/pywfa @.> Cc: Kez Cleal @.>; Comment @.> Subject: Re: [kcleal/pywfa] Import Error on M1 Mac Python 3.10 (Issue #6)

External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu ddolenni.

Tried conda install and pip install on WSL2 with python 3.11 as well just out of curiosity... both say they worked but:

pip:

import pywfa Traceback (most recent call last): File "", line 1, in File "/home/redacted/miniconda3/envs/py-3.11/lib/python3.11/site-packages/pywfa/init.py", line 2, in from .align import WavefrontAligner, clip_cigartuples, cigartuples_to_str, elide_mismatches_from_cigar ImportError: /home/redacted/miniconda3/envs/py-3.11/lib/python3.11/site-packages/pywfa/align.cpython-311-x86_64-linux-gnu.so: undefined symbol: wavefront_align

Conda says it successfully installs on linux but:

from pywfa.align import WavefrontAligner Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pywfa'

— Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkcleal%2Fpywfa%2Fissues%2F6%23issuecomment-1487622686&data=05%7C01%7Cclealk%40cardiff.ac.uk%7C197e9e8cca4d482ee5c808db2fd40da3%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C638156360021530957%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=it4Gjm%2FiS%2FA5HECUcJ%2BxTIuq%2FbnvF9GT8SRgDYjRVs4%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKIBQHIHHCTF36MU664B7W3W6NKKBANCNFSM6AAAAAAWLCCTV4&data=05%7C01%7Cclealk%40cardiff.ac.uk%7C197e9e8cca4d482ee5c808db2fd40da3%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C638156360021530957%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=f902D8EkXUls44qFauNOlBMIhhUgCfzgtLkzc8ukzQQ%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

kcleal commented 1 year ago

Hi all, the build recipe has changed for pywfa, so it's possible some of these issues have been fixed...