1

I've installed numpy using

sudo pip install -I --prefix=/soft/bin/system/python/3.7.4 numpy

I can now import numpy but numpy has access to none of its attributes.

I dont know what to set in path/config to make it working.

I tried while loading the module python3.7.4 setting things up

prepend-path    PATH    /soft/bin/system/python/3.7.4/bin
prepend-path LD_LIBRARY_PATH /soft/bin/system/python/3.7.4/lib/:/soft/bin/system/python/3.7.4/lib/:/soft/bin/system/python/3.7.4/lib/python3.7/site-packages/
setenv PYTHONPATH /soft/bin/system/python/3.7.4/lib/python3.7/site-packages

but nothing works and it's been 2 days now.

i have this kind of error

bioinfo@frontal:~$ python -c 'import numpy; numpy.test("full");'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'numpy' has no attribute 'test'

bioinfo@frontal:~$ which python
/soft/bin/system/python/3.7.4/bin/python

edit : the pythonpath variable was wrong and now, the error updated

bioinfo@tao:~$ python -c 'import numpy; numpy.sin;'
Traceback (most recent call last):
  File "/soft/bin/system/python/3.7.4/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in <module>
    from . import multiarray
  File "/soft/bin/system/python/3.7.4/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in <module>
    from . import overrides
  File "/soft/bin/system/python/3.7.4/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/soft/bin/system/python/3.7.4/lib/python3.8/site-packages/numpy/__init__.py", line 145, in <module>
    from . import core
  File "/soft/bin/system/python/3.7.4/lib/python3.8/site-packages/numpy/core/__init__.py", line 48, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/soft/bin/system/python/3.9/bin/python"
  * The NumPy version is: "1.20.3"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

further investigation in the folder

/soft/bin/system/python/3.7.4/lib/python3.8/site-packages/numpy/core

there is a file called

_multiarray_umath.cpython-38-x86_64-linux-gnu.so

why is not found, is the name alright or it's a bug from installing with pip ?

5
  • What about something like sin? Jun 11, 2021 at 13:36
  • I updated pythonpath with the python3.8 path and the error evolved ! now it's a module missing numpy.core._multiarray_umath i updated the main post
    – ul.Duc
    Jun 11, 2021 at 13:58
  • Run which pip. Also, why the prefix? Jun 11, 2021 at 14:06
  • /usr/bin/pip for the which pip (on the frontal) i'm on a cluster as i think i said and i have to install modules withing the python folder from the version needed
    – ul.Duc
    Jun 11, 2021 at 14:08
  • bioinfo@frontal:~$ pip --version pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) why would this be ?
    – ul.Duc
    Jun 11, 2021 at 14:10

1 Answer 1

1

I updated trinityrnaseq (the main tool using NumPy) in 2.12.0 with singularity and all works fine.

Added on behalf of the question author.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.