user1551817
user1551817

Reputation: 7461

Error message using the acor Python module

I'm trying to run some code which uses a python module acor.

When I run my code I get the error:

AttributeError: module 'acor' has no attribute 'acor'

The only thing I can find online about this is this link. Someone suggest a fix in which:

import _acor is replaced by import acor._acor as _acor.

I tried this, but I still get the same error. I am using Python 3.9.7

Upvotes: 0

Views: 253

Answers (1)

Cubix48
Cubix48

Reputation: 2681

After comparing the version of acor available via Pip, and the one available on Github, it appears that the two versions are not identical, exclusively in __init__.py and acor.py files. See here for the changes.

In order to avoid the error AttributeError: module 'acor' has no attribute 'acor', you should use the version available on Github, which contains the fix.

Method 1

You can install the version via the source code available on Github.

Uninstall the current version:

pip uninstall acor

Clone the git repository:

git clone https://github.com/dfm/acor.git

Compile and install acor:

cd acor
python setup.py install

Method 2

You can also make the changes manually.

Identify the location of the acor module:

python -c "import acor; print(acor.__path__)"

Modify acor.py and __init__.py located in this folder:

__init__.py line 9:

from .acor import *

acor.py line 5:

from . import _acor

Upvotes: 1

Related Questions