acor icon indicating copy to clipboard operation
acor copied to clipboard

acor function not showing up in module -- anaconda python 3.3

Open astronomeralex opened this issue 12 years ago • 5 comments

I've successfully installed acor, but when I try to use it as directed, python throws an error and doesn't think the function acor is in the acor module.

import acor import numpy as np a = np.random.rand(500) acor(a) Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable

I'm using clang, and python 3.3 via anaconda

astronomeralex avatar Aug 05 '14 18:08 astronomeralex

sorry, and this error, too.

acor.acor(a) Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'acor'

astronomeralex avatar Aug 05 '14 18:08 astronomeralex

I just pushed a change. Works for me in 3.4 now. Try using the GitHub version and see if it works for you.

P.S. the most recent version of emcee includes a pure Python version of acor that is probably better for most problems. See the docs and consider giving it a try.

dfm avatar Aug 05 '14 18:08 dfm

Well, I get a different error now. progress! I forked and downloaded the new version and used python setup.py install. Also, the emcee acor seems useful.

In [1]: import acor

ImportError Traceback (most recent call last) in () ----> 1 import acor

/astro/grads/arh5361/code/acor/acor/init.py in () 7 """ 8 ----> 9 from .acor import * 10

/astro/grads/arh5361/code/acor/acor/acor.py in () 3 import numpy as np 4 ----> 5 from . import _acor 6 7

ImportError: cannot import name _acor

astronomeralex avatar Aug 05 '14 18:08 astronomeralex

you need to run

python setup.py build_ext --inplace

or

python setup.py install

first.

dfm avatar Aug 05 '14 18:08 dfm

thanks, everything works now!

astronomeralex avatar Aug 05 '14 18:08 astronomeralex