简体   繁体   中英

Numpy not having access to its libs HPC environment-module

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM