mrzv/dionysus

Simplex() does not work on fresh install

tmelorc opened this issue · 3 comments

I am really having problem to follow installation instructions. I have a new machine where I never used Dionysus before.

Just now, I did (following instructions):

  1. pip install --verbose dionysus
  2. pip install --verbose --upgrade dionysus

Output of 2 was:

Installed version (2.0.4) is most up-to-date (past versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4) Requirement already up-to-date: dionysus in .local/lib/python2.7/site-packages

  1. I created a minimal py file to test some commands from http://mrzv.org/software/dionysus2/tutorial/basics.html
import dionysus as d
s = d.Simplex([0,1,2])

and when compiled with Python 2.7:

Traceback (most recent call last):
  File "dionysus.py", line 1, in <module>
    import dionysus as d
  File "/home/thiago/Dropbox/Programacao/dionysus/dionysus.py", line 2, in <module>
    s = d.Simplex([0,1,2])
AttributeError: 'module' object has no attribute 'Simplex'

I tried also other examples from the documentation, but no success (for example, d.Filtration() also does not work).

I appreciate any help how to install (using pip or from git, or anything else). I really would like to test Dionysus2.

Thanks in advance.

mrzv commented

For whatever reason, it's picking up the file /home/thiago/Dropbox/Programacao/dionysus/dionysus.py as the dionysus module, instead of what's installed in ~/.local/lib/python2.7/site-packages. This can be happening for multiple reasons. My best guess is that you are running your code from the directory /home/thiago/Dropbox/Programacao/dionysus, which contains dionysus.py, and then Python simply follows its standard rules and picks up the wrong module. The other thing to check is your Python path, to make sure it contains the right directories. What does the following snippet output?

import sys
print sys.path

Dear mzrv, thanks for your explanation. After you told me I discovered that the problem is in the file name. I rename the file to test.py and everything is working with the minimal example code.

Thanks again.

mrzv commented

Great. Thanks for letting me know.