pyimfit icon indicating copy to clipboard operation
pyimfit copied to clipboard

Issue importing pyimfit

Open V3c70r1n0 opened this issue 1 year ago • 4 comments

I am able to succesfuly install pyimfit but whenever I try to import it this happens and I am not sure how solve it.


ImportError Traceback (most recent call last) Cell In[6], line 1 ----> 1 import pyimfit

File /opt/anaconda3/lib/python3.11/site-packages/pyimfit/init.py:4 1 # This file defines what is visible to the outside world when the package 2 # (pyimfit) is imported 3 from .descriptions import * ----> 4 from .pyimfit_lib import convolve_image, make_imfit_function, ModelObjectWrapper 5 from .pyimfit_lib import FixImage 6 from .pyimfit_lib import PsfOversampling

ImportError: dlopen(/opt/anaconda3/lib/python3.11/site-packages/pyimfit/pyimfit_lib.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '__Z12AddFunctionsP11ModelObjectRKNSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEERSA_RNS2_IiNS6_IiEEEEbiRNS2_INS1_3mapIS8_S8_NS1_4lessIS8_EENS6_INS1_4pairIKS8_S8_EEEEEENS6_ISO_EEEE'

V3c70r1n0 avatar Apr 15 '24 21:04 V3c70r1n0

Hmm... OK, can you give me some information about your system and setup? It looks like you're using macOS, but what version? And what type of machine: esp. which processor type -- Intel or Apple Silicon?

Also, what command did you use to install pyimfit?

perwin avatar Apr 16 '24 10:04 perwin

I am using a mac on Sonoma 14.4.1 and I am on a apple silicon max (m3 pro), I know that pyimfit isn't compiled for arm macbooks but I used the code below to create a conda environment to run it. I downloaded it using pip install.

conda create -n my_x86_env -y conda activate my_x86_env conda config --env --set subdir osx-64

V3c70r1n0 avatar Apr 16 '24 15:04 V3c70r1n0

OK, thanks.

I can't reproduce that on my (Intel) MacBook Pro, but let me see what happens if I try doing that on my M1 MacBook Pro. (I get other problems on my Intel machine, so I may need to buckle down and try making a proper conda package.)

(I haven't tried doing anything with conda on my M1 machine; I'm a little surprised it automatically created an x86 environment...)

perwin avatar Apr 16 '24 20:04 perwin

There are experimental conda packages for PyImfit now, including arm64 (Apple silicon) versions. You might try installing it into an arm64 conda environment and see if that works. The installation command is

conda install -c conda-forge perwin::pyimfit

perwin avatar Jun 16 '24 17:06 perwin