| View previous topic :: View next topic |
| Author |
Message |
Basilio n00b

Joined: 04 Feb 2010 Posts: 16
|
Posted: Sun Dec 17, 2017 4:25 pm Post subject: Problems with python after emerge @world && depclean |
|
|
The main issue is that python cannot use numpy (I need python2.7, that is intended: inkscape export svg to dxf requires python2.7 and numpy.linalg).
| Code: |
Python 2.7.14 (default, Dec 17 2017, 19:16:08)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/lib64/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib64/python2.7/site-packages/numpy/lib/__init__.py", line 19, in <module>
from .polynomial import *
File "/usr/lib64/python2.7/site-packages/numpy/lib/polynomial.py", line 20, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib64/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/usr/lib64/python2.7/site-packages/numpy/linalg/linalg.py", line 30, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
>>>
|
libgfortran.so.3 is missing on my system.
I can find libgfortran.so.4 :
| Code: |
$ locate libgfortran.so
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.2.0/libgfortran.so
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.2.0/libgfortran.so.4
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.2.0/libgfortran.so.4.0.0
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.2.0/32/libgfortran.so
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.2.0/32/libgfortran.so.4
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.2.0/32/libgfortran.so.4.0.0
|
It seems some parts of the python2.7 were compiled against older libs, but I cannot figure which ones.
I have re-emerged python2.7 and numpy with recent gcc 7.2.0, that is the only compiler currently present on the system. With no effect.
emerge -DuNva @world finds nothing to rebuild. @preserved-rebuilds empty too. |
|
| Back to top |
|
 |
ct85711 Veteran

Joined: 27 Sep 2005 Posts: 1791
|
Posted: Sun Dec 17, 2017 4:57 pm Post subject: |
|
|
Try rebuilding lapack-reference, and see if that helps fixes the issue. From a little research, gfortran is pulled in through the lapack USE flag on numpy.
| Quote: | File "/usr/lib64/python2.7/site-packages/numpy/linalg/linalg.py", line 30, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory |
The error, gives a hint indicating lapack is the issue (put in bold). |
|
| Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 22088
|
Posted: Sun Dec 17, 2017 5:05 pm Post subject: |
|
|
For a wholly missing shared object, revdep-rebuild may be able to find the affected package. Try ct85711's solution first, since that is based on your specific error. If that doesn't help, or you still have similar problems, check whether revdep-rebuild detects any packages that require a rebuild.
Theoretically, subslots and preserved-libs should prevent this type of problem, but there may be special rules when the providing package is gcc. If there aren't such special rules, you may have found a case where a subslot should have been used and was not. This is not too surprising, since subslots are maintained by hand, so they usually aren't added unless somebody encounters a case where they would be helpful. |
|
| Back to top |
|
 |
Basilio n00b

Joined: 04 Feb 2010 Posts: 16
|
Posted: Sun Dec 17, 2017 5:25 pm Post subject: |
|
|
I have just rebuilt lapack-reference-3.7.0, I am on ~amd64
It seems it's building scripts link exactly against libgfortran.so.3
| Code: |
$ ldd /usr/lib64/liblapack.so.3
linux-vdso.so.1 (0x00007ffc57df6000)
libblas.so.3 => /usr/lib64/libblas.so.3 (0x00007f99c64dd000)
libgfortran.so.4 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/libgfortran.so.4 (0x00007f99c6101000)
libm.so.6 => /lib64/libm.so.6 (0x00007f99c5daf000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/libgcc_s.so.1 (0x00007f99c5b98000)
libc.so.6 => /lib64/libc.so.6 (0x00007f99c57d5000)
libgfortran.so.3 => not found
libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/libquadmath.so.0 (0x00007f99c5595000)
/lib64/ld-linux-x86-64.so.2 (0x00007f99c6fff000)
|
libgfortran.so.3 => not found for freshly built package.
I'll try examine its ebuild and building scripts |
|
| Back to top |
|
 |
Basilio n00b

Joined: 04 Feb 2010 Posts: 16
|
Posted: Sun Dec 17, 2017 5:37 pm Post subject: |
|
|
Ok, problem solved.
I had to re-emerge lapack-reference *and* blas-reference. |
|
| Back to top |
|
 |
mao n00b

Joined: 22 Mar 2017 Posts: 47 Location: Poland
|
Posted: Mon Nov 25, 2019 10:15 am Post subject: |
|
|
Lately I encountered the similar problem, i.e.:
| Code: |
...
File "/usr/lib64/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/usr/lib64/python2.7/site-packages/numpy/linalg/linalg.py", line 31, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
|
I emerged sci-libs/lapack, virtual/lapack, virtual/cblas, virtual/blas and re-emerged affected dev-python/numpy and it also works.
Thank you. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|