Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

module compiled against API version 0xc but this version of numpy is 0xb #106

Closed
Spugnam opened this issue Dec 18, 2017 · 18 comments
Closed

Comments

@Spugnam
Copy link

Spugnam commented Dec 18, 2017

Hi, I wasn't able to install catalyst.

Here's my environment info:

  • Operating System: macOS
  • Python Version: Python 3.6.3
  • Python Bitness: 64
  • How did you install Catalyst:
    I tried:
    pip install enigma-catalyst matplotlib

then:
pip install -r requirements.txt

and both gave me a similar error (below).

  • Python packages:
    aiodns==1.1.1
    aiohttp==2.3.6
    alembic==0.7.7
    async-timeout==2.0.0
    bcolz==0.12.1
    boto3==1.4.8
    botocore==1.8.15
    Bottleneck==1.0.0
    cchardet==2.1.1
    ccxt==1.10.283
    certifi==2017.11.5
    chardet==3.0.4
    click==4.0
    contextlib2==0.4.0
    cycler==0.10.0
    cyordereddict==0.2.2
    Cython==0.25.2
    decorator==4.0.0
    docutils==0.14
    empyrical==0.2.1
    enigma-catalyst==0.4.0
    idna==2.6
    intervaltree==2.1.0
    jmespath==0.9.3
    Logbook==0.12.5
    lru-dict==1.1.4
    Mako==1.0.1
    MarkupSafe==0.23
    matplotlib==2.1.1
    multidict==3.3.2
    multipledispatch==0.4.8
    networkx==1.9.1
    numexpr==2.6.1
    numpy==1.13.1
    pandas==0.19.2
    pandas-datareader==0.2.1
    patsy==0.4.0
    pycares==2.3.0
    pyparsing==2.2.0
    python-dateutil==2.4.2
    python-editor==1.0.3
    pytz==2016.4
    requests==2.9.1
    requests-file==1.4.1
    requests-ftp==0.3.1
    s3transfer==0.1.12
    scipy==0.17.1
    six==1.10.0
    sortedcontainers==1.4.4
    SQLAlchemy==1.0.8
    statsmodels==0.6.1
    tables==3.3.0
    toolz==0.8.2
    urllib3==1.22
    yarl==0.16.0

I tried to execute catalyst --version to check installation was successful and got:
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb Traceback (most recent call last): File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/bin/catalyst", line 7, in <module> from catalyst.__main__ import main File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/__init__.py", line 25, in <module> from .utils.run_algo import run_algorithm File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 13, in <module> from catalyst.data.bundles import load File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/data/bundles/__init__.py", line 2, in <module> from . import quandl # noqa File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/data/bundles/quandl.py", line 21, in <module> from catalyst.data.bundles.core import register_bundle File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/data/bundles/core.py", line 14, in <module> from ..us_equity_pricing import ( File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/data/us_equity_pricing.py", line 23, in <module> from bcolz import ( File "/Users/Quentin/Documents/Projects/Catalyst/catalyst-venv/lib/python3.6/site-packages/bcolz/__init__.py", line 55, in <module> from bcolz.carray_ext import ( ImportError: numpy.core.multiarray failed to import

I tried with numpy 1.13.3 (latest) and 1.13.1 (from requirements.txt) but nothing worked...

thanks

@fredfortier
Copy link
Contributor

fredfortier commented Dec 18, 2017 via email

@arsanjea
Copy link

arsanjea commented Dec 19, 2017

We tested with python 2.7 and we are getting the exact same issue.

@fredfortier
Copy link
Contributor

fredfortier commented Dec 19, 2017 via email

@brandonclosson
Copy link

brandonclosson commented Dec 22, 2017

I had this issue with both bcolz and bottleneck importing from numpy. I believe for me it was an issue with both packages being installed with an incorrect version of numpy I had cached on my machine. I was able to resolve both by uninstalling them and running pip install with the --no-cache-dir option.

These are the commands I ran:

pip uninstall bcolz
pip install bcolz --no-cache-dir
pip uninstall bottleneck
pip install bottleneck --no-cache-dir

@fredfortier
Copy link
Contributor

fredfortier commented Dec 22, 2017 via email

@itsjaked
Copy link

I'm having a similar issue although not exactly the same, figured I'd post it here:

Traceback (most recent call last): File "/usr/local/bin/catalyst", line 7, in <module> from catalyst.__main__ import main File "/usr/local/lib/python2.7/site-packages/catalyst/__init__.py", line 25, in <module> from .utils.run_algo import run_algorithm File "/usr/local/lib/python2.7/site-packages/catalyst/utils/run_algo.py", line 15, in <module> from catalyst.exchange.factory import get_exchange File "/usr/local/lib/python2.7/site-packages/catalyst/exchange/factory.py", line 3, in <module> from catalyst.exchange.ccxt.ccxt_exchange import CCXT File "/usr/local/lib/python2.7/site-packages/catalyst/exchange/ccxt/ccxt_exchange.py", line 11, in <module> from catalyst.algorithm import MarketOrder File "/usr/local/lib/python2.7/site-packages/catalyst/algorithm.py", line 89, in <module> from catalyst.pipeline import Pipeline File "/usr/local/lib/python2.7/site-packages/catalyst/pipeline/__init__.py", line 4, in <module> from .classifiers import Classifier, CustomClassifier File "/usr/local/lib/python2.7/site-packages/catalyst/pipeline/classifiers/__init__.py", line 1, in <module> from .classifier import ( File "/usr/local/lib/python2.7/site-packages/catalyst/pipeline/classifiers/classifier.py", line 11, in <module> from catalyst.lib.labelarray import LabelArray File "/usr/local/lib/python2.7/site-packages/catalyst/lib/labelarray.py", line 30, in <module> from ._factorize import ( File "catalyst/lib/_factorize.pyx", line 10, in init catalyst.lib._factorize (catalyst/lib/_factorize.c:11047) File "__init__.pxd", line 989, in numpy.import_array (catalyst/lib/_factorize.c:10338) ImportError: numpy.core.multiarray failed to import

@fredfortier
Copy link
Contributor

fredfortier commented Dec 23, 2017 via email

@itsjaked
Copy link

Thanks for the quick response, but no change. I tried that earlier when I initially encountered the error. I'll keep playing with it to see if I can find a fix, but may just give up and set it up on Ubuntu.

@fredfortier
Copy link
Contributor

fredfortier commented Dec 23, 2017

Try sending me the output of this command if you can:

pip freeze --local

I'll diff it with mine. Which OS are you using now?

@itsjaked
Copy link

Running macOS 10.13.1, and here you are:

alembic==0.9.6
asn1crypto==0.22.0
backports.functools-lru-cache==1.4
bcolz==0.12.1
boto3==1.5.6
botocore==1.8.20
Bottleneck==1.2.1
ccxt==1.10.456
certifi==2017.7.27.1
cffi==1.10.0
chardet==3.0.4
click==6.7
conda==4.3.30
contextlib2==0.5.5
cryptography==2.0.3
cycler==0.10.0
cyordereddict==1.0.0
Cython==0.27.3
decorator==4.1.2
docutils==0.14
empyrical==0.2.1
enigma-catalyst==0.4.0
enum34==1.1.6
futures==3.2.0
idna==2.6
intervaltree==2.1.0
ipaddress==1.0.18
jmespath==0.9.3
Logbook==1.1.0
lru-dict==1.1.6
Mako==1.0.7
MarkupSafe==1.0
matplotlib==2.1.1
multipledispatch==0.4.9
networkx==2.0
numexpr==2.6.4
numpy==1.13.1
pandas==0.19.2
pandas-datareader==0.5.0
patsy==0.4.1
pycosat==0.6.2
pycparser==2.18
pyOpenSSL==17.2.0
pyparsing==2.2.0
PySocks==1.6.7
python-dateutil==2.6.1
python-editor==1.0.3
pytz==2017.3
requests==2.18.4
requests-file==1.4.2
requests-ftp==0.3.1
ruamel-yaml==0.11.14
s3transfer==0.1.12
scipy==1.0.0
six==1.11.0
sortedcontainers==1.5.9
SQLAlchemy==1.1.15
statsmodels==0.8.0
subprocess32==3.2.7
tables==3.4.2
toolz==0.9.0
urllib3==1.22

@brandonclosson
Copy link

@itsjaked as I referenced in my previous post with other packages, if you run pip uninstall catalyst and then pip install catalyst --no-cache-dir, I believe your error will be resolved

@itsjaked
Copy link

@brandonclosson Awesome, thanks, issue has been resolved. I did try that previously, but most likely had another dependency issue at that time.

@wnklb
Copy link

wnklb commented Dec 29, 2017

@fredfortier @brandonclosson I've tried --no-cache-dir and various package version on several packages (bcolz, bottleneck, numpy, catalyst) through python2/3 without any success. However running pip install enigma-catalyst matplotlib --no-cache-dir in the first place, fixed this. Thanks!

@mdgart
Copy link

mdgart commented Jan 3, 2018

Same issue here, I can confirm that pip install enigma-catalyst matplotlib --no-cache-dir works!

@fredfortier
Copy link
Contributor

I'm going to close this as it looks like it's more about python and less Catalyst. Feel free to reopen if I misunderstand the root cause or it continues to occur.

@waniz
Copy link

waniz commented Feb 1, 2018

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

I catched this error yesterday. In my case: I have installed Tensorflow 1.5 and Pytorch 0.3 and they, in some case, install numpy both to the anaconda root. Hence I had numpy 0.14 and 0.13.3 both. I deleted it and reinstall numpy (0.14). Everything works out.

@czg9
Copy link

czg9 commented Jan 6, 2019

I have met the same problem with you:

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

And I solved it by upgrading my numpy to 1.14.1

@itskrishnadev
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants