Skip to content
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: libgfortran.3.dylib #3658

Closed
balzer82 opened this issue May 16, 2014 · 8 comments
Closed

ImportError: libgfortran.3.dylib #3658

balzer82 opened this issue May 16, 2014 · 8 comments

Comments

@balzer82
Copy link

I am working on MacOS Mavericks and made

sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
--->  Computing dependencies for py27-numpy
--->  Cleaning py27-numpy
--->  Computing dependencies for py27-scipy
--->  Cleaning py27-scipy
--->  Computing dependencies for py27-matplotlib
--->  Cleaning py27-matplotlib
--->  Computing dependencies for py27-ipython
--->  Cleaning py27-ipython
--->  Computing dependencies for py27-pandas
--->  Cleaning py27-pandas
--->  Computing dependencies for py27-sympy
--->  Cleaning py27-sympy
--->  Computing dependencies for py27-nose
--->  Cleaning py27-nose
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

And I installed GFortran, which is located in /usr/local/gfortran/.

But when I try to

python
Python 2.7.6 (default, Apr  9 2014, 11:48:52) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.interpolate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/scipy/interpolate/__init__.py", line 160, in <module>
    from .interpolate import *
  File "/Library/Python/2.7/site-packages/scipy/interpolate/interpolate.py", line 15, in <module>
    import scipy.special as spec
  File "/Library/Python/2.7/site-packages/scipy/special/__init__.py", line 546, in <module>
    from ._ufuncs import *
ImportError: dlopen(/Library/Python/2.7/site-packages/scipy/special/_ufuncs.so, 2): Library not loaded: /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libgfortran.3.dylib
  Referenced from: /Library/Python/2.7/site-packages/scipy/special/_ufuncs.so
  Reason: image not found
@pv
Copy link
Member

pv commented May 16, 2014

This does not seem like a bug on our side, but more like a compiler installation issue, so closing the ticket. You can try asking on stackoverflow or mailing lists.

@pv pv closed this as completed May 16, 2014
@matthew-brett
Copy link
Contributor

Are you sure that python is picking up the macports python there?

Does macports really install its scipy into /Library/Python/2.7/site-packages/scipy ?

@balzer82
Copy link
Author

You guys are completely right!! I forced to rebuild everything, now it works:

sudo pip install --upgrade --force-reinstall numpy
sudo pip install --upgrade --force-reinstall scipy

👍

@exowanderer
Copy link

exowanderer commented Dec 12, 2017

3+ years later ... same problem ... same solution!

Thank you all -- especially @balzer82 for coming back and giving us the solution after you found it!

@Rachine
Copy link

Rachine commented May 17, 2018

Matlab runtime was messing around some of my python libs:

  • had to remove Matlab runtime totally from my mac
  • had to rebuild everything also

@HairuiLiu
Copy link

helped so much ~~ though i still wonder why reinstall numpy and scipy worked

@Ido-PX
Copy link

Ido-PX commented Feb 13, 2019

2019 and the same tip helped. Thanks @balzer82

@pmaji
Copy link

pmaji commented Mar 29, 2019

This still works as a solution! Had this problem recently with the pyjanitor package and this fixed it right away (after trying many other solutions). Link to the notebook that it had broken below, for context. Thank you @balzer82 for this!

https://github.com/pmaji/data-science-toolkit/blob/master/eda-and-visualization/radar_charts.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants