Skip to content
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

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd #4281

Closed
sobeit2020 opened this issue Jan 30, 2021 · 13 comments · Fixed by #4284
Closed
Labels
Install Problems with installation Question Questions - will be closed after some period of inactivity.

Comments

@sobeit2020
Copy link
Contributor

Describe your environment

Debian 10
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
ccxt==1.40.99
freqtrade develop-16dad8b6
numpy 1.19.5

Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

Explain the problem you have encountered

Steps to reproduce:

Newly done installation, on new system, performed with ./script.sh -i method
questions were answered during installation as follows:
-y
dev:-y
plot:-n
hyperopt:-n

freqtrade trade --config config.json --strategy SampleStrategy fails to start

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
2021-01-30 22:02:55,644 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
  File "/root/freqtrade/freqtrade/main.py", line 37, in main
    return_code = args['func'](args)
  File "/root/freqtrade/freqtrade/commands/trade_commands.py", line 13, in start_trading
    from freqtrade.worker import Worker
  File "/root/freqtrade/freqtrade/worker.py", line 15, in <module>
    from freqtrade.freqtradebot import FreqtradeBot
  File "/root/freqtrade/freqtrade/freqtradebot.py", line 19, in <module>
    from freqtrade.edge import Edge
  File "/root/freqtrade/freqtrade/edge/__init__.py", line 1, in <module>
    from .edge_positioning import Edge, PairInfo  # noqa: F401
  File "/root/freqtrade/freqtrade/edge/edge_positioning.py", line 8, in <module>
    import utils_find_1st as utf1st
  File "/root/freqtrade/.env/lib/python3.7/site-packages/utils_find_1st/__init__.py", line 3, in <module>
    from .find_1st import find_1st
ImportError: numpy.core.multiarray failed to import
@sobeit2020 sobeit2020 added the Triage Needed Issues yet to verify label Jan 30, 2021
@sobeit2020
Copy link
Contributor Author

pip install numpy --upgrade works, something has to be updated in the files, when you figure out what, could you tell me please, thanks

@xmatthias xmatthias added Install Problems with installation Question Questions - will be closed after some period of inactivity. and removed Triage Needed Issues yet to verify labels Jan 31, 2021
@xmatthias
Copy link
Member

it would appear that numpy is up and downgraded during installation.

The logs during the installation should tell if that's happening - i suspect it's a pinned install-dep version on find_1st (it has numpy as install dependency, so numpy MUST be installed before it's installed).
So if they pin the version on install, but not on run, numpy might be installed twice, first a older version, then a newer one.

@Fusseldieb
Copy link

Yup, same problem. Searched for about 2 hours and found nothing...

(.env) fusseldieb@home-nuc:~/freqtrade$ freqtrade trade --config config.json --strategy SampleStrategy
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
2021-01-31 09:24:40,898 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
  File "/home/fusseldieb/freqtrade/freqtrade/main.py", line 37, in main
    return_code = args['func'](args)
  File "/home/fusseldieb/freqtrade/freqtrade/commands/trade_commands.py", line 13, in start_trading
    from freqtrade.worker import Worker
  File "/home/fusseldieb/freqtrade/freqtrade/worker.py", line 15, in <module>
    from freqtrade.freqtradebot import FreqtradeBot
  File "/home/fusseldieb/freqtrade/freqtrade/freqtradebot.py", line 19, in <module>
    from freqtrade.edge import Edge
  File "/home/fusseldieb/freqtrade/freqtrade/edge/__init__.py", line 1, in <module>
    from .edge_positioning import Edge, PairInfo  # noqa: F401
  File "/home/fusseldieb/freqtrade/freqtrade/edge/edge_positioning.py", line 8, in <module>
    import utils_find_1st as utf1st
  File "/home/fusseldieb/freqtrade/.env/lib/python3.8/site-packages/utils_find_1st/__init__.py", line 3, in <module>
    from .find_1st import find_1st
ImportError: numpy.core.multiarray failed to import
(.env) fusseldieb@home-nuc:~/freqtrade$

@xmatthias
Copy link
Member

@Fusseldieb what's your numpy version (pip freeze | grep numpy) ?

after that, please try pip install -U numpy - and post the output of this here (and also if it works after running this).

@Fusseldieb
Copy link

Fusseldieb commented Jan 31, 2021

@Fusseldieb what's your numpy version (pip freeze | grep numpy) ?

after that, please try pip install -U numpy - and post the output of this here (and also if it works after running this).

Thanks for the quick reply!

I did just solve it somehow.

I went into the virtual env and did pip3 install --upgrade numpy

Now it runs ahahaha

@xmatthias
Copy link
Member

xmatthias commented Jan 31, 2021

i guess it's related to the numpy 1.20.0 release.

I suspect that 1.20.0 is installed as build dependency, and later replaced by the pinned version - causing this "compilation conflict".
I'll bump the numpy version in develop soon, that should resolve this.

edit
In my opinion, it's a failure of pip resolution though - as it should recognize that numpy (1.19.5) is beeing installed with the same command, and the build-dependency should therefore be the same.
As consequence of this, i've opened pypa/pip#9542 in hopes to have this fixed in pip.

@emejinglilcompany
Copy link

thx for this

@alvarosan
Copy link

Thanks for this (https://pypi.org/project/py-find-1st/) fix also @xmatthias . Because of my setup I needed to still build freqtrade against numpy 1.19.5, so bumping py-find-1st to Version 1.1.5 (2021-02-02) fixed my problems.

@neilyoung
Copy link

Same issue here out of the blue. I have a requirements.txt for my project, which explicitly requires numpy=1.19.3. Same error as above on a fresh installation (Ubuntu 20.04 on a Banana PI M2Z). Some other module must have required 1.20. After having applied the update command everything works.
Thanks

@shek510
Copy link

shek510 commented Jul 22, 2021

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/home/pi/Desktop/pyun0rick.py", line 15, in
import matplotlib
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/init.py", line 107, in
from . import _api, cbook, docstring, rcsetup
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/rcsetup.py", line 26, in
from matplotlib.colors import Colormap, is_color_like
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/colors.py", line 82, in
from matplotlib import _api, cbook, scale
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/scale.py", line 18, in
from matplotlib.ticker import (
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/ticker.py", line 179, in
from matplotlib import transforms as mtransforms
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/transforms.py", line 46, in
from matplotlib._path import (
ImportError: numpy.core.multiarray failed to import

how to resolve this error

@xmatthias
Copy link
Member

This is neither related to freqtrade, nor to the problem discussed in this topic.
Please use google / the appropriate support channels for Numpy (or potentially matplotlib) to get help on this topic.

@caranguyen
Copy link

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/home/pi/Desktop/pyun0rick.py", line 15, in
import matplotlib
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/init.py", line 107, in
from . import _api, cbook, docstring, rcsetup
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/rcsetup.py", line 26, in
from matplotlib.colors import Colormap, is_color_like
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/colors.py", line 82, in
from matplotlib import _api, cbook, scale
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/scale.py", line 18, in
from matplotlib.ticker import (
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/ticker.py", line 179, in
from matplotlib import transforms as mtransforms
File "/home/pi/.local/lib/python3.7/site-packages/matplotlib/transforms.py", line 46, in
from matplotlib._path import (
ImportError: numpy.core.multiarray failed to import

how to resolve this error

did you find a solution? i'm stuck on the same issue

@xmatthias
Copy link
Member

Letme repeat what i said above - this is NOT related to freqtrade - please stop abusing other repositories / issues.

@freqtrade freqtrade locked as resolved and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Install Problems with installation Question Questions - will be closed after some period of inactivity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants