-
Notifications
You must be signed in to change notification settings - Fork 11
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
ImportError: numpy.core.multiarray failed to import #12
Comments
Sad to see that you are having issues. I am currently on holiday until January 5th, and I cannot do any debugging myself on a machine with macOSX until then. However, from your prompt it looks like you have used a conda virtual environment when installing livermask. I don't really use conda myself, as I historically have had all kinds of issues with it. Personally, I prefer From this thread it seems like a lot of people have had the same issue, and it was resolved by downgrading numpy. However, I am not sure that will fix your issues. But you could try. Simply run the command (after install of livermask):
If this isn't working, could you try making a virtual environment with virtualenv and installing, like so:
The package was setup to work with pip, and any incompatibilities with conda, is somewhat outside of what I can do currently. At least on macOSX. Also, which Python and pip versions are you using? Would be nice to know if you are using regular Python 3.x or the one from conda. If you have two, as you have conda installed, check which versions are in use by:
If you have some specific python-version installed, such as python3.6, you could also run the command:
|
@GiuliaZorzi One of my co-workers, @jpdefrutosSINTEF, was able to perform some tests on macOSX for me. He does not have access to an M1 macbook, but I believe livermask should be forward compatible on said operating system. We found some bugs, which have now been fixed. A new patch release has been made. For info on edits, see here. However, the bugs we found are not related to the issue you have. I believe you have this problem as you installed livermask using conda instead of pip. Therefore, to install and use livermask, this should work (will install the most recent version with the new bug fixes):
If you observe any problems, I recommend adding the To avoid these things from happening in the future, I have added inference test workflows for all three operating systems. They seem to build, install, and run livermask well on the cloud (on a fresh install). See here for information regarding the build. Therefore, using I am closing for now, but if you experience any new issues, please, let me know :] |
@GiuliaZorzi did you manage to get it working? livermask is now published on PyPI, and you can therefore install it simply by:
Would be nice to know whether this is an M1-related issue or not. Unit tests are also performed on the cloud for building, installing, and testing the software, and everything seems to work using pip. |
Hello,
I want to use livermask to segment CT images as a part of a project through my organization. We are really excited to use your tool because it will automate a lot of the segmentation we would have otherwise had to do. However, I stumbled on the following error:
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/Users/giulia/.conda/envs/liver/bin/livermask", line 33, in
sys.exit(load_entry_point('livermask==1.3.0', 'console_scripts', 'livermask')())
File "/Users/giulia/.conda/envs/liver/bin/livermask", line 25, in importlib_load_entry_point
return next(matches).load()
File "/Users/giulia/.conda/envs/liver/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/Users/giulia/.conda/envs/liver/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/Users/giulia/.conda/envs/liver/lib/python3.8/site-packages/livermask-1.3.0-py3.8.egg/livermask/livermask.py", line 6, in
from scipy.ndimage import zoom
File "/Users/giulia/.conda/envs/liver/lib/python3.8/site-packages/scipy-1.5.4-py3.8-macosx-11.0-arm64.egg/scipy/ndimage/init.py", line 151, in
from .filters import *
File "/Users/giulia/.conda/envs/liver/lib/python3.8/site-packages/scipy-1.5.4-py3.8-macosx-11.0-arm64.egg/scipy/ndimage/filters.py", line 37, in
from . import _nd_image
ImportError: numpy.core.multiarray failed to import
I have installed numpy==1.19.5 as requested by livermask and I work on a Macos M1 machine.
Could you please help me?
The text was updated successfully, but these errors were encountered: