Search code examples
numpypip

cannot get numpy to be detected when installing aeneas


On windows with python 3.13.1, when running pip install for something (aeneas) I cannot resolve: You must install numpy before installing aeneas

I've tried many different approaches, including following older stackoverflow posts on the matter.

I hoped this approach at least would work:

python -m venv myenv
.\myenv\Scripts\Activate
pip install numpy
pip list

Package Version
------- -------
numpy   2.2.1
pip     24.3.1

pip install aeneas

Collecting aeneas
  Using cached aeneas-1.7.3.0.tar.gz (5.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      [ERRO] You must install numpy before installing aeneas
      [INFO] Try the following command:
      [INFO] $ sudo pip install numpy
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

pip install setuptools
pip install --upgrade pip setuptools wheel
pip install --no-build-isolation aeneas

...You must install numpy before installing aeneas

Solution

  • The last two commands are right except that the package is old and requires numpy.distutils. That means it needs numpy version 1 and not 2. Also numpy.distutils was removed in python 3.12. So the solution is to use Python 3.11 and:

    pip install --upgrade pip setuptools wheel "numpy<2"
    pip install --no-build-isolation aeneas