Coder Social home page Coder Social logo

ImportError: dlopen about fortran_magic HOT 4 CLOSED

mgaitan avatar mgaitan commented on September 16, 2024
ImportError: dlopen

from fortran_magic.

Comments (4)

astrojuanlu avatar astrojuanlu commented on September 16, 2024

I'm having this same issue now that I patched #14.

from fortran_magic.

astrojuanlu avatar astrojuanlu commented on September 16, 2024

Just for completeness, it's not OS X specific: I'm experiencing this on Linux too.

In [1]: %load_ext fortranmagic
/home/fdodev/miniconda3/envs/py34/lib/python3.4/site-packages/IPython/utils/path.py:264: UserWarning: get_ipython_cache_dir has moved to the IPython.paths module
  warn("get_ipython_cache_dir has moved to the IPython.paths module")

In [2]: %%fortran
   ...: subroutine foo
   ...: end
   ...: 
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-f1fd164a03d9> in <module>()
----> 1 get_ipython().run_cell_magic('fortran', '', 'subroutine foo\nend\n')

/home/fdodev/miniconda3/envs/py34/lib/python3.4/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
   2291             magic_arg_s = self.var_expand(line, stack_depth)
   2292             with self.builtin_trap:
-> 2293                 result = fn(magic_arg_s, cell)
   2294             return result
   2295 

/home/fdodev/miniconda3/envs/py34/lib/python3.4/site-packages/fortranmagic.py in fortran(self, line, cell)

/home/fdodev/miniconda3/envs/py34/lib/python3.4/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194 
    195         if callable(arg):

/home/fdodev/miniconda3/envs/py34/lib/python3.4/site-packages/fortranmagic.py in fortran(self, line, cell)
    363 
    364         self._code_cache[key] = module_name
--> 365         module = imp.load_dynamic(module_name, module_path)
    366         self._import_all(module, verbosity=args.verbosity)
    367 

ImportError: /home/fdodev/.cache/ipython/fortran/_fortran_magic_c4c4e6b95608557f83493040db65cd39.cpython-34m.so: cannot open shared object file: No such file or directory

These are the contents of the cache directory:

$ ls ~/.cache/ipython/fortran/ -l
total 4
-rw-r--r-- 1 fdodev fdo 19 2015-12-01 16:56 _fortran_magic_c4c4e6b95608557f83493040db65cd39.f90

from fortran_magic.

astrojuanlu avatar astrojuanlu commented on September 16, 2024

This consistently fails on Python 3 with IPython 2.x, 3.x and 4.x. On the contrary, on Python 2 works fine in all cases.

from fortran_magic.

astrojuanlu avatar astrojuanlu commented on September 16, 2024

Sorry for the noise, but I found out what's going on. This is actually a consequence of #9: when using Python 3, f2py refers to the system binary and f2py3 should be used.

$ source activate py27
discarding /home/fdodev/miniconda3/bin from PATH
prepending /home/fdodev/miniconda3/envs/py27/bin to PATH
(py27)$ which f2py
/home/fdodev/miniconda3/envs/py27/bin/f2py
(py27)$ source deactivate
discarding /home/fdodev/miniconda3/envs/py27/bin from PATH
$ source activate py34
discarding /home/fdodev/miniconda3/bin from PATH
prepending /home/fdodev/miniconda3/envs/py34/bin to PATH
(py34)$ which f2py
/usr/bin/f2py
(py34)$ which f2py
f2py   f2py3  
(py34)fdodev@vmppgsdev:~> which f2py3
/home/fdodev/miniconda3/envs/py34/bin/f2py3

from fortran_magic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.