-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import error for pyhsmm examples #55
Comments
Whoo, fixed! The main problem seems to have been trying to set it up in a virtualenv. I did some more digging into other issues and #22 seemed similar. I followed your suggestion there to try these commands
For anyone reading this, the commands only worked properly for me outside my virtualenv. I had to clone pybasicbayes again inside pyhsmm, but the examples seem to work now. No virtualenv is slightly annoying, but I'll take it. |
Actually, I just remembered I will have to use my virtualenv later for nonlocal development. So I guess the question now is why activating a virtualenv causes the following error trace when running hmm.py (or any example):
|
Glad you like the library! Hope we can get it to work for you. Compilation problems are a pain. You shouldn't need to clone pybasicbayes inside pyhsmm (though I used to organize things that way). It should be importable (e.g. from doing The main problem looks like a compilation issue. The module hmm_messages_interface gets created during the compilation process, and a compilation error would prevent it from being created. (I wrote the setup.py file to continue installing even if the extension modules failed to build because you can still use parts of the library without the low-level code, though the examples won't work and the library will be less useful.) The error seems to be that your system doesn't like confusing an The problem is either in how the C is getting generated via cython or in some difference between your compilation toolchain and mine. If it's a problem with the cython code generation, the first step would probably be to ensure you're on the most up-to-date cython. You can check with python -c 'import cython; print cython.__version__' I'm on 0.23.4. If you're on a much older version, it would be good to download and install anaconda or miniconda and installing cython through conda. Even if you're on that same version of cython, it may be a good idea to try using a fresh conda-installed version, since your error looks like some disagreement about the details of your platform between cython and your compiler. If it's a problem with compiling the generated code, a first step would be to use the same compiler as I'm using (as seemed to help in #23). I have tested clang at some point before, and yours looks like a recent version, but I always use gcc. (On Mac OS, the name If those two steps (updating cython and switching to gcc) don't help, I can try to reproduce things on my system. |
Awesome, it wasn't working with gcc 4.9 but I downgraded to 4.8 and it seems to be good now. Having an issue with plots (matplotlib backends) but that's an unrelated issue I can figure out on my own. Thanks! |
Hrm I'd really like it to work with 4.9. Thanks for letting me know. If you find anything else related, it'd be great to update this thread. Glad to hear it looks like it's working! |
I set up travis to test gcc 4.9 on Ubuntu (in addition to 4.8) and the build worked, so there must be something different about either Mac OS or your particular setup. I'll update this thread if I get a chance to test on Mac OS, but at least things seem to work as intended on linux. (On my main work machine I'm using gcc 5.3.0, which also works.) |
I did a little more digging around and it seems to work only on a remote linux server and not on a local Mac environment. Reopening this in hopes of getting the local setup working as well. The remote server has gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC). Local setup has gcc version 4.8.5 (MacPorts gcc48 4.8.5_0). I linked gcc locally with 'sudo port select --set gcc mp-gcc45', but I'm a bit of a newb at setting things up, so let me know if I'm not actually using the right gcc here. Both setups have cython 0.23.4. Local setup has Anaconda, not sure what the linux server is using. The full error trace for build_ext is
Not sure what gcc-4.8: error: unrecognized command line option '-Wshorten-64-to-32' is... have you seen that before? |
I have seen that one before. It's a clang-specific flag, meaning the python you're using was built with clang in mind. I believe the flags get generated based on how Python itself was compiled. Are you sure you're using the anaconda python and not the system python? You can double check with |
See e.g. this issue. |
hm.. so I was using a virtualenv so you were right, I was using a system python. But when I deactivated that and checked I was using Anaconda, now I get a different trace:
|
Maybe try a clean first (remove the build directory, all .so files, etc). |
You should be able to run |
Still running into the same problem :( |
Tried switching to gcc-4.9 and get this
|
I think this try/except in setup.py is suppressing useful error information here. Can you comment out or delete that whole |
I'm going to try printing the exception traceback even when proceeding with the installation process using these ideas. |
commented that block out but get same error trace |
Actually, I lied, but the only difference is instead of setup.py:35: UserWarning: Failed to build extension modules I get this error: command 'gcc-4.8' failed with exit status 1 |
There are a lot of google hits for that error message, "suffix or operands invalid for `movq". I haven't seen this before, so those are probably your best bet. |
This has to be some awful joke... I just reran python setup.py install except with sudo and it worked. haha, what a fix |
Hey Matt, thanks for your work here.
I'm trying to run some of the examples and I'm getting ImportError: No module named hmm_messages_interface.
Full trace is here:
I think this must be related to an issue I had running python setup.py install. While I am able to import pyhsmm, the install command had an error in it:
For gcc I have
Is there something else I need to do with python setup.py install?
Thanks!
The text was updated successfully, but these errors were encountered: