strawlab / pyopy

Python bindings to interesting matlab libraries for data analysis
Other
86 stars 16 forks source link

ImportError when calling prepare() #12

Open ajmazurie opened 8 years ago

ajmazurie commented 8 years ago

When trying to replicate the demo at https://asciinema.org/a/18771 on my OSX box I get an ImportError. Here is the code:

from pyopy.hctsa import hctsa
hctsa.prepare()

And here is the resulting traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "project/.conda_environments/root/lib/python2.7/site-packages/pyopy/hctsa/hctsa.py", line 16, in prepare
    from hctsa_install import hctsa_prepare_engine
  File "project/.conda_environments/root/lib/python2.7/site-packages/pyopy/hctsa/hctsa_install.py", line 10, in <module>
    from pyopy.hctsa.hctsa_bindings_gen import gen_bindings
  File "project/.conda_environments/root/lib/python2.7/site-packages/pyopy/hctsa/hctsa_bindings_gen.py", line 8, in <module>
    from pyopy.hctsa.hctsa_catalog import HCTSACatalog
  File "project/.conda_environments/root/lib/python2.7/site-packages/pyopy/hctsa/hctsa_catalog.py", line 13, in <module>
    from pyopy.code import matlab_funcname_from_filename, parse_matlab_params, parse_matlab_funcdef
  File "project/.conda_environments/root/lib/python2.7/site-packages/pyopy/code.py", line 11, in <module>
    from pyopy.externals.ompc.ompcply import translate_to_str
ImportError: No module named externals.ompc.ompcply

Any idea about what is causing this?

Best, Aurélien

astraw commented 8 years ago

The best person to track this down is @sdvillal, but he broke his arm recently and it may be a little while to fix this. I did just talk to him and he plans to respond here.

cmiller8 commented 8 years ago

I got the same error and traceback on OSX 10.11.5 El Capitan with Python 2.7.11 installed by Anaconda.

I get the same error when I try to run python hctsa_install.py install from the pyopy module folder

yasserfarouk commented 8 years ago

Same problem here on OSX 10.11.5

binny-mathew commented 8 years ago

Same problem here.

sdvillal commented 8 years ago

I think this was just a silly packaging problem. Hopefully it is fixed now. I have just updated the instructions to install pyopy + hctsa, fixed a bunch of bugs and send the first release to pypi. Can anyone confirm that the problem is solved?

I never tried before to use pyopy in non-linux systems, but everything seems to work without much trouble in OSX - which is a pleasant surprise to me.

Sorry for taking so long to answer. I will hopefully be more responsive from now on.

nathaliehb commented 5 years ago

Hey, I have followed the instruction, I had to create a new environment with python 3.5 and I have installed pyopy , however, when enter the following command hctsa-cli install --engine matlab --force-download --generate-bindings

module = __import__(self.module_name, fromlist=['__name__'], level=0) File "c:\pyopy\pyopy\hctsa\hctsa_cli.py", line 5, in <module> from pyopy.hctsa.hctsa_bindings_gen import gen_bindings File "c:\pyopy\pyopy\hctsa\hctsa_bindings_gen.py", line 7, in <module> from pyopy.hctsa.hctsa_config import HCTSA_BINDINGS_FILE, HCTSA_BINDINGS_DIR File "c:\pyopy\pyopy\hctsa\hctsa_config.py", line 3, in <module> from pyopy.config import PYOPY_DIR, PYOPY_EXTERNAL_TOOLBOXES_DIR File "c:\pyopy\pyopy\config.py", line 4, in <module> from user import home ImportError: No module named 'user'

nathaliehb commented 5 years ago

I looked at the config.py and i believe I should have a user.py somewhere but I don't really know what to put in it...

sdvillal commented 5 years ago

@nathaliehb unfortunately this is python 3 incompatibility (see #13). Also I never tested this on windows, so you are in terra incognita. This concrete problem is fixed in the py3 branch, but I lack bandwidth these days to retake the work there, so I would suggest to try using python 2 for the time being.

nathaliehb commented 5 years ago

Oh thanks for coming back to me. It was a bit frustrating today trying to install it and having to correct the bracket for the print function and other bit and for the end having to give up. Sure, I will try to create a environment with python 2 on windows and if I still struggle I will try this on my mac.