pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 87 forks source link

modules in package not found after import #135

Closed Mattyboi123 closed 2 years ago

Mattyboi123 commented 4 years ago

I tried to perform the example recurrence network analysis described on the pyunicorn website as below in spyder in python 3.7 on windows 10

import numpy as np from pyunicorn.timeseries import RecurrenceNetwork

x = np.sin(np.linspace(0, 10 * np.pi, 1000)) net = RecurrenceNetwork(x, recurrence_rate=0.05) print(net.transitivity())

However it returns AttributeError: module 'pyunicorn' has no attribute 'timeseries'

various things that I tried resulted in further errors - essentially I can't get any functionality out of the package. Additionally the pip install didn't work (although I have igraph installed already) so I cloned the zip archive from Github, but I can't get it to work

jkroenke commented 4 years ago

How did you install pyunicorn for the first time and can you try the following installation procedure?

  1. Open an Anaconda prompt and install the Minimalist GNU Compiler Toolchain by typing:
    conda install libpython m2w64-toolchain -c msys2
  2. Download the zip-files of pyunicorn from the repository.
  3. Open the file pyunicorn/core/_ext/numerics.pyx and exchange "srand48()" with "srand()" and "drand48()" with "rand()"
  4. Install pyunicorn with::
    python setup.py install
Mattyboi123 commented 4 years ago

all good up until the last step.

I notice that there are now folders and files which were missing from my previous clone, such as the numerics.pyx file. I changed the lines that you said and saved the file, then I typed

'python setup.py install'

in the prompt but it returned an error

'python: can't open file 'setup.py': [Errno 2] No such file or directory'

I tried anyway to run code form one of the examples but I still get the output

'No module named 'pyunicorn.timeseries''

jkroenke commented 4 years ago

Did you make sure that you changed the directory to the pyunicorn directory where the setup script is located before typing 'python setup.py install'?

Mattyboi123 commented 4 years ago

I had not done that, now I have, a new error was returned,

'command failed with exit status 1'

Mattyboi123 commented 4 years ago

the error trail refers to the absence of srand48 and drand48, was the earlier instruction to change those to () a means of making the process stop at that point as a check, so I should now change them back to 48?

Mattyboi123 commented 4 years ago

I tried that a new error is returned...

Mattyboi123 commented 4 years ago

now when attempting to run the code in spyder, the timeseries module is found, but now the the following error appears

'No module named 'pyunicorn.core._ext.numerics''

jkroenke commented 4 years ago

This is probably due to issue #130

Mattyboi123 commented 4 years ago

issue #130 doens't seem to have been rectified though or am I missing something?

ntfrgl commented 2 years ago

Thank you for reporting this issue, and please accept our apologies for our delay in providing a rigorous solution. This set of problems should be fully resolved with the commit linked above, which will be reflected in an upcoming new release including official wheels. I'm tentatively closing this ticket, but please let us know in case you have any trouble installing pyunicorn from the current master branch, in which case we will attempt to find a solution as quickly as possible.

Cython is now declared as a build dependency, which means that your Python package manager (e.g., pip) is responsible for automatically providing the Cython compiler without any user intervention. After the package installation process is completed, Cython is not required as a runtime dependency. The version information is now retrieved via importlib.metadata from the Python standard library.