Comments (7)
Hey @vallism, you are right, thanks for the report.
This bug was introduced after #8 . Before that, instead to run the command f2py
via a subprocess call, we directly called the f2py.main()
function.
I'm not sure if the better idea is to undo that change and handle the Window's problem it fixes with a different approach, or make the call to the proper f2py
script depending the python version.
For the latter, I'm not sure if append the python version would be enough. For example, in my computer (w/ubuntu) I have these:
tin@morochita:~/lab/fortran_magic$ f2py<tab>
f2py f2py2.7 f2py3.4
but is this common to any system/os?
from fortran_magic.
This may be a question for the numpy.f2py developers. I looked in their github, and there's no mention of f2py3, so I suspect that it may be something that packagers add.
On my anaconda Python 2.7 + 3.4 installation on OS X, I have f2py under the main /bin directory, and f2py3 under the python 3 sub-environment. On my homebrew Python 2.7 + 3.4 installation, I have only f2py2.7 in /usr/local/bin; the pip-installed numpy creates f2py for both Python 2.7 and 3, but with the wrong hash-bang... Basically, it's all over the place.
Perhaps you could do the awkward thing, and call f2py.main on anything else than windows. Another solution, less transparent to the user but still OK IMHO, would be to allow selecting the f2py executable in the iPython magic.
from fortran_magic.
Maybe the great numpy's maintainers @charris or @juliantaylor can help us: Is there a multiplatform python2/3 compatible way to run f2py programatically (i.e from Python) ?
from fortran_magic.
should just be numpy.f2py.compile
the f2py binary is just a wrapper around numpy.f2py
functions so you should be able to do everything from python
from fortran_magic.
no idea why it originally doesn't work for windows directly from python. that would be interesting to figure out but i have no windows.
otherwise maybe one can use the python -m thing (pep338), with python being sys.executable, though I have no idea if that invocation method works with f2py, but that should be fixable if not
from fortran_magic.
too bad doesn't work, but added numpy/numpy#5565
from fortran_magic.
I just checked and replacing the f2py
call with python -m numpy.f2py
works, but it requires NumPy 1.10 (see numpy/numpy@29c019a). Since it seems to be the simplest solution, @mgaitan would you accept a pull request with this change and tag a new release?
from fortran_magic.
Related Issues (20)
- intent(hide) HOT 1
- ImportError: dlopen HOT 4
- Bytes/string error on Python 3.5 and IPython 4.0
- how to pass intel64 ifort compiler option from jupyter notebook?
- IPython warning HOT 5
- UnicodeDecodeError when debugging fortran code
- Running the Example notebook fails HOT 1
- fortranmagic sometimes works, sometimes doesn't
- version 0.7?
- Does not work on python3 HOT 1
- Ipython and Javascript error
- Retrieve fortran source code HOT 4
- failed to load fortranmagic HOT 5
- Getting gfortran compiler error when running example HOT 6
- Number bugs HOT 2
- Incompatible with Numpy 1.26 & Python 3.12
- External library and optimisation flags HOT 15
- NameError with Python 3.3 HOT 1
- Problem running on Windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fortran_magic.