pwollstadt / IDTxl

The Information Dynamics Toolkit xl (IDTxl) is a comprehensive software package for efficient inference of networks and their node dynamics from multivariate time series data using information theory.
http://pwollstadt.github.io/IDTxl/
GNU General Public License v3.0
237 stars 76 forks source link

cython module not imported #86

Open BernhardBandow opened 2 years ago

BernhardBandow commented 2 years ago

I quick test after installing idtxl 1.4 resulted in a message "Error importing Cython fast embedding module...". Cython definitely was instelld before. It turned out that "python hde_setup.py build_ext --inplace" and copying the result into the idtxl folder solved the issue. I would recommend to document this.

axelhutt commented 1 year ago

Hallo, I had the same problem on the MacOS 12.5.1. Where do you compile hde_setup.py ? If I do it in IDTxl/idtxl (where hde_setup.py is located), I get the error message "could not create idtxl/hde_fast_embedding.cpython-39-darwin.so: No such file or directory". Can you help me out here ?

mwibral commented 1 year ago

Hi all, the code has to be compiled on each traget machine adfter installation. The compile command for the cython code has to be executed in the right folder, or else the resulting compiled object has to be moved to the right location. Michael Lindner wrote that functionality - he said he left details instructions as comments in the code. Could check and come back to me if that doesn't help? Thanks.

Best, Michael

On Tue, 2022-11-15 at 03:49 -0800, axelhutt wrote:

Hallo, I had the same problem on the MacOS 12.5.1. Where do you compile hde_setup.py ? If I do it in IDTxl/idtxl (where hde_setup.py is located), I get the error message "could not create idtxl/hde_fast_embedding.cpython- 39-darwin.so: No such file or directory". Can you help me out here ? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

pwollstadt commented 1 year ago

Hi all, I added a description of the installation process to this wiki page. Please note that the Cython fast embedding module is only needed for the history-dependence estimator. If you are not using it, the message does not affect you. I will modify the error message to make this clear.

@infrareziduzi, out of curiosity, could you tell me which test you ran to get the error message?

qifnwang commented 1 year ago

the code has to be compiled on each traget machine adfter installation. The compile command for the cython code has to be executed in the right folder, or else the resulting compiled object has to be moved to the right location. Michael Lindner wrote that functionality - he said he left details instructions as comments in the code. Could check and come back to me if that doesn't help? Thanks.

Hi, Have you solved that? I got the same problem, and I moved 'hde_fast_embedding.cp39-win_amd64.pyd' to IDTXL/idtxl folder. But it still cannot import. Do you have any idea? Thanks

mschart commented 7 months ago

Same here:

In [10]: network_analysis = MultivariateTE() ...: settings = {'cmi_estimator': 'JidtGaussianCMI', ...: 'max_lag_sources': 5, ...: 'min_lag_sources': 1} ...: results = network_analysis.analyse_network(settings=settings, ...: data=d0)

####### analysing target with index 0 from list [0, 1]

Error importing Cython fast embedding module. Continuing with slow Python implementation.

This may take a long time.
axelhutt commented 7 months ago

Hallo,

I had this problem several months ago and 'solved' it by copying the corresponding library to the local directory where you call the script. This is just a workaround and no real solution, but it helped me to get results.

Good luck with it.

Axel

mschart commented 7 months ago

Thanks Axel, I ran it in the IDTxl/idtxl folder and the error message is gone. It still takes a long time, however. Spectral Granger was instantaneous in comparison (via Eden-Kramer/spectral-connectivity).