metocean / wavespectra

MIT License
1 stars 1 forks source link

Dependency for numpy not automatically installed if not already installed #31

Open MatthewWPL opened 3 years ago

MatthewWPL commented 3 years ago

When creating a fresh venv and installing wavespectra in it does not recognise numpy as a dependency and comes up with the error:

ModuleNotFoundError: No module named 'numpy'

Can this be rectified in the next release?

MatthewWPL commented 3 years ago

Thanks for your email @jorgeperezg,

please see below, when I try to install it on a fresh env... it sees an error that 'No module named numpy'

image

After installing numpy, it then successfully works:

image

jorgeperezg commented 3 years ago

Thanks @MatthewWPL ,we have the following imports in setup.py: from numpy.distutils.core import setup from numpy.distutils.misc_util import Configuration

We'll try to get rid of those or at least improve the installation instructions.

cmichelenstrofer commented 1 year ago

I think the solution from the second answer here should work.

It would look something like:

from setuptools import dist
dist.Distribution().fetch_build_eggs(['numpy'])

We did this successfully in another project.

cmichelenstrofer commented 1 year ago

Note that the process suggested above is deprecated soon. The better solution is to switch to the newer pyproject.toml instead of setup.py

DEPRECATION: wavespectra is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559