When installing SciPy 1.7.1 from source on Linux using
python setup.py build
python setup.py install
(along with environment and site.cfg hacking as needed) I end up with a broken build. My particular build recipe works for SciPy <= 1.6
Once SciPy 1.7.1 is built, importing e.g. scipy.optimize or scipy.special results in errors
AttributeError: module 'scipy.special._ufuncs_cxx' has no attribute 'pyx_capi'
ImportError: cannot import name 'levinson' from 'scipy.linalg._solve_toeplitz'
ImportError: cannot import name 'csgraph_to_dense' from 'scipy.sparse.csgraph._tools'
What has changed, and how do I solve this?
Looking at the
site-packagesdirectory I see that SciPy 1.7 installs itself as a zipped Python egg, whereas previous versions used to install as directories (though still Python eggs). This behaviour can be chosen by specifying thezip_safeargument tosetuptools.setup(), called from withinsetup.py. In SciPy 1.7 this is called aswith
metadatanot including'zip_safe', meaning that whether zipped eggs are safe to use are automatically determined. This might also be the case for older SciPy versions, but for whatever reason the process ends up declaring zipped eggs to be safe for 1.7 on my system, which does not seem to be the case.Manually adding
above
setup(**metadata)prior to executingsetup.pyresults in the egg being a directory (as opposed to a zipped archive), and the build works.To do the patching of
setup.pyprogramatically, use e.g. (GNU sed)