KoboldAI / KoboldAI-Client

For GGUF support, see KoboldCPP: https://github.com/LostRuins/koboldcpp
https://koboldai.com
GNU Affero General Public License v3.0
3.46k stars 747 forks source link

Local setup: No module named 'numpy.core._multiarray_umath' #359

Closed catbears closed 1 year ago

catbears commented 1 year ago

Hi I am on Debian 12 and wanted to install the KoboldAI. After trying several times (with deleting, cloning again), I always get the same error: No module named 'numpy.core._multiarray_umath'

It says some more actually

$ ./play.sh 
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.9/site-packages/numpy-1.23.2-py3.9-linux-x86_64.egg/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/home/user/.local/lib/python3.9/site-packages/numpy-1.23.2-py3.9-linux-x86_64.egg/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/home/user/.local/lib/python3.9/site-packages/numpy-1.23.2-py3.9-linux-x86_64.egg/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aiserver.py", line 58, in <module>
    from utils import debounce
  File "/home/user/Documents/Code/koboldai/koboldai-client/utils.py", line 11, in <module>
    from transformers import __version__ as transformers_version
  File "/home/user/Documents/Code/koboldai/koboldai-client/runtime/envs/koboldai/lib/python3.8/site-packages/transformers/__init__.py", line 30, in <module>
    from . import dependency_versions_check
  File "/home/user/Documents/Code/koboldai/koboldai-client/runtime/envs/koboldai/lib/python3.8/site-packages/transformers/dependency_versions_check.py", line 17, in <module>
    from .utils.versions import require_version, require_version_core
  File "/home/user/Documents/Code/koboldai/koboldai-client/runtime/envs/koboldai/lib/python3.8/site-packages/transformers/utils/__init__.py", line 34, in <module>
    from .generic import (
  File "/home/user/Documents/Code/koboldai/koboldai-client/runtime/envs/koboldai/lib/python3.8/site-packages/transformers/utils/generic.py", line 27, in <module>
    import numpy as np
  File "/home/user/.local/lib/python3.9/site-packages/numpy-1.23.2-py3.9-linux-x86_64.egg/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/home/user/.local/lib/python3.9/site-packages/numpy-1.23.2-py3.9-linux-x86_64.egg/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/home/user/Documents/Code/koboldai/koboldai-client/runtime/envs/koboldai/bin/python"
  * The NumPy version is: "1.23.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

I can see, that it's a bit of a mess with the python versions, but when I python3 -V then I get Python 3.11.2.

How to resolve this? Why does KoboldAI use Python3.8? The numpy link was not helpful actually. I'd update everything but I haven't figured out how to source / activate the environment :smile:

Any ideas appreciated

henk717 commented 1 year ago

Looks like you having colliding python environments, try the version in my own github which has increased isolation against this stuff. We use Python 3.8 for maximum OS compatibility.

catbears commented 1 year ago

Thanks for the input!

I tried, failed and while upgrading my Debian to 12, I stumbled over a bug in the Debian installer (long story) which in turn had me set up Bullseye again. Now it works, as my Python mess got naturally cleaned up.