-
-
Notifications
You must be signed in to change notification settings - Fork 11k
f2py test fail in pip installed numpy-1.10.1 in virtualenv #6718
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
Comments
Ah, OS X. IIRC, pip is not recommended for the mac, homebrew or one of the other third party package managers is preferred. |
hmmm, well as all other tests pass like a charm, i actually suspect this to be a test issue rather than a real one: https://github.com/numpy/numpy/blob/master/numpy/tests/test_scripts.py#L67 |
The assumption in the test that |
i inserted a print statement after the line linked above: f2py_cmd = 'f2py' + basename(sys.executable)[6:]
print f2py_cmd
code, stdout, stderr = run_command([f2py_cmd, '-v']) prints |
Hmm, OK. |
i went ahead to test this in a virtualenv on a Ubuntu 14.04 server i have... didn't break, but observe this:
it seems as if the system-wide installed python-numpy debian package provides a
so it's definitely not only a mac issue (will change title), but rather a pip install issue? i think the idea to deduce the |
I've got both
The tests should probably skip all that and go directly to |
For instance
seems to do what is intended at the point of failure. |
i think the failing test actually intends to somehow make sure that the the problem is that it does weird failing magic to determine the different names until now in my tests i didn't encounter a single environment setup where no so maybe to cover the intention of the test better it would be easiest to just trying to call |
so a simple change of https://github.com/numpy/numpy/blob/master/numpy/tests/test_scripts.py#L67 f2py_cmd = 'f2py' + basename(sys.executable)[6:] to f2py_cmd = 'f2py' |
It's not guaranteed that any f2py is available on PATH: |
hmm, didn't think about that :-/ but wouldn't the current version with |
Yes, any test that assumes the f2py script is available on PATH fails in this case. I don't think there's a reliable way to locate where the script got installed, except maybe somehow via pip's install record file. |
Chuck - pip is the standard way to install on the Mac, I think. I'm guessing it's me who put in the test, to test for the problem we had previously where the executable was not correctly installed : #5817 It would be a shame not to test that bug, but of @pv is right, there's no guarantee the install put the script onto the users path. On the other hand, the case of |
I guess one could argue that it's fair to raise a test failure when the
|
i'd be happy if it raises an error if |
Putting this here for the experts to consider. Fedora 23 VM PATH=$HOME/local/Python35/bin:$PATH
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
#Load variables for Intel Parallel Studio
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh intel64 Python 3.5.1rc1 install: ./configure --prefix=$HOME/local/Python35 --enable-loadable-sqlite-extensions CFLAGS=-fPIC
make
make install
ln -s /home/andrew/local/Python35/bin/python3 /home/andrew/local/Python35/bin/python
ln -s /home/andrew/local/Python35/bin/pip3 /home/andrew/local/Python35/bin/pip Numpy 1.10.2rc1 install -- with edits for intel mkl to site.cfg, intelccompiler.py and intel.py. installed from source dir using: pip install --global-option=config --global-option="--compiler=intelem" --global-option=build_clib --global-option="--compiler=intelem" --global-option=build_ext --global-option="--compiler=intelem" -v . Now the relevant (i think) part [andrew@localhost ~]$ python -c 'import numpy; numpy.test("full");'
Running unit tests for numpy
NumPy version 1.10.2rc1
NumPy relaxed strides checking option: True
NumPy is installed in /home/andrew/local/Python35/lib/python3.5/site-packages/numpy
Python version 3.5.1rc1 (default, Dec 2 2015, 14:58:12) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)]
nose version 1.3.7 Known fails and warnings removed ======================================================================
ERROR: test_scripts.test_f2py
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andrew/local/Python35/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/andrew/local/Python35/lib/python3.5/site-packages/numpy/testing/decorators.py", line 146, in skipper_func
return f(*args, **kwargs)
File "/home/andrew/local/Python35/lib/python3.5/site-packages/numpy/tests/test_scripts.py", line 68, in test_f2py
code, stdout, stderr = run_command([f2py_cmd, '-v'])
File "/home/andrew/local/Python35/lib/python3.5/site-packages/numpy/tests/test_scripts.py", line 48, in run_command
proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
File "/home/andrew/local/Python35/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/home/andrew/local/Python35/lib/python3.5/subprocess.py", line 1544, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'f2py'
----------------------------------------------------------------------
Ran 6155 tests in 144.203s
FAILED (KNOWNFAIL=4, SKIP=4, errors=1) no f2py in path, only f2py3.5 in Python35/bin, result of some test I don't understand thrown in [andrew@localhost ~]$ which f2py
/usr/bin/which: no f2py in (/opt/intel/compilers_and_libraries_2016.1.150/linux/bin/intel64:/opt/intel/compilers_and_libraries_2016.1.150/linux/mpi/intel64/bin:/opt/intel/debugger_2016/gdb/intel64_mic/bin:/home/andrew/local/Python35/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/andrew/.local/bin:/home/andrew/bin)
[andrew@localhost ~]$ ls local/Python35/bin/
2to3 f2py3.5 nosetests pip3 pydoc3.5 python3.5 python3.5m-config pyvenv-3.5
2to3-3.5 idle3 nosetests-3.5 pip3.5 python python3.5-config python3-config
easy_install-3.5 idle3.5 pip pydoc3 python3 python3.5m pyvenv
[andrew@localhost ~]$ python -c'from numpy.f2py import main; main()' -v
2 Can i just create a symlink for f2py that points to f2py3.5 ? |
Hopefully this does not break something else. cd ~/local/Python35/bin
ln -s f2py3.5 f2py [andrew@localhost bin]$ python -c 'import numpy; numpy.test();'
Running unit tests for numpy
NumPy version 1.10.2rc1
NumPy relaxed strides checking option: True
NumPy is installed in /home/andrew/local/Python35/lib/python3.5/site-packages/numpy
Python version 3.5.1rc1 (default, Dec 2 2015, 14:58:12) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)]
nose version 1.3.7
..............................S.....................................................
----------------------------------------------------------------------
Ran 5972 tests in 35.126s
OK (KNOWNFAIL=4, SKIP=4) |
TST: only test f2py, not f2py2.7 etc, fixes #6718
* 'master' of git://github.com/numpy/numpy: (24 commits) BENCH: allow benchmark suite to run on Python 3 TST: test f2py, fallback on f2py2.7 etc., fixes numpy#6718 BUG: link cblas library if cblas is detected BUG/TST: Fix for numpy#6724, make numpy.ma.mvoid consistent with numpy.void BUG/TST: Fix numpy#6760 by correctly describing mask on nested subdtypes BUG: resizing empty array with complex dtype failed DOC: Add changelog for numpy#6734 and numpy#6748. Use integer division to avoid casting to int. Allow to change the maximum width with a class variable. Add some tests for mask creation with mask=True or False. Test that the mask dtype if MaskType before using np.zeros/ones BUG/TST: Fix for numpy#6729 ENH: Avoid memory peak and useless computations when printing a MaskedArray. ENH: Avoid memory peak when creating a MaskedArray with mask=True/False (numpy#6732). BUG: Readd fallback CBLAS detection on linux. TST: Fix travis-ci test for numpy wheels. MAINT: Localize variables only used with relaxed stride checking. BUG: Fix for numpy#6719 MAINT: enable Werror=vla in travis BUG: Include relevant files from numpy/linalg/lapack_lite in sdist. ...
This problem still exists with numpy 1.10.2rc2 on x86_64-apple-darwin15 and should be re-opened. |
I think I will just disable/remove the test. It seems to depend to much on factors out of our control. @matthew-brett @njsmith Thoughts? |
Maybe just raise a warning? |
I worry that we can easily get this wrong again in the future. How about checking that, if |
Maybe we could make the test only run on our well-controlled CI infrastructure, and skip it when running on arbitrary end user systems? |
If this test fails it doesn't hurt anything, right? On the other hand, it seems that it doesn't always help either. The current error message is "wasn't able to find f2py or %s on commandline". Would it be resonable to leave as an error, but change the message to something like "Warning: neither %s nor %s found in path". Here I wonder if it is safe to keep the search for bare "f2py"? |
IIUC the point of the test is to alert us in case we break the script entry point (again) -- Matthew correct me if I'm wrong. Assuming that's correct, then a warning doesn't seem fit-for-purpose to me, because we generally only look at travis-ci test output when some test actually fails. If it's just a warning we'll likely miss it. OTOH it sounds like there may be no way to make the test fully reliable on random end user machines, which causes user distress and confusion (as we've seen), so maybe a warning makes sense here... or possibly no message at all? No idea if users care about seeing this or whether it would just cause more confusion. |
Still present in released 1.10.2. Any suggestions on how to convert this test from an error to a warning?
|
Hmm, |
gh-6916 should have fixed the |
Might as well close. It is possible that the test could still fail, but if that happens we can deal with it then. |
I have built numpy from source on several platforms (AMD64 and Intel64) against BLAS and Intel MKL. In most occasions, I build for python3.6. I have never had the Frankly, it's all a little nuts, and could be fixed right quick. I can make a pull request that would change Looking at insights, it would appear that Pearu Peterson is no longer active on f2py, but would @charris mind? Does that sound reasonable? |
PRs are always welcome. f2py used to be a separate package and there are still lots of odd bits scattered about. |
running
python -c 'import numpy ; numpy.test();'
i get the following error about test_f2py:The text was updated successfully, but these errors were encountered: