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

fixes for numpy2 #259

Closed
wants to merge 1 commit into from
Closed

fixes for numpy2 #259

wants to merge 1 commit into from

Conversation

gnzsnz
Copy link

@gnzsnz gnzsnz commented Aug 20, 2024

code fixes for numpy2

@gnzsnz gnzsnz mentioned this pull request Aug 20, 2024
@gnzsnz
Copy link
Author

gnzsnz commented Aug 20, 2024

after changes i manage to compile

pip install cython setuptools
./rebuid-cython.sh
pip install -e .[test]

however zipline --help fails

$ zipline --help

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "/Users/gonzo/.pyenv/versions/zipline/bin/zipline", line 5, in <module>
    from zipline.__main__ import main
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/__init__.py", line 29, in <module>
    from .utils.run_algo import run_algorithm
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/utils/run_algo.py", line 19, in <module>
    from zipline.data import bundles
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/bundles/__init__.py", line 2, in <module>
    from . import quandl  # noqa
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/bundles/quandl.py", line 15, in <module>
    from . import core as bundles
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/bundles/core.py", line 13, in <module>
    from ..adjustments import SQLiteAdjustmentReader, SQLiteAdjustmentWriter
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/adjustments.py", line 23, in <module>
    from ._adjustments import load_adjustments_from_sqlite
Traceback (most recent call last):
  File "/Users/gonzo/.pyenv/versions/zipline/bin/zipline", line 5, in <module>
    from zipline.__main__ import main
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/__init__.py", line 29, in <module>
    from .utils.run_algo import run_algorithm
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/utils/run_algo.py", line 19, in <module>
    from zipline.data import bundles
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/bundles/__init__.py", line 2, in <module>
    from . import quandl  # noqa
    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/bundles/quandl.py", line 15, in <module>
    from . import core as bundles
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/bundles/core.py", line 13, in <module>
    from ..adjustments import SQLiteAdjustmentReader, SQLiteAdjustmentWriter
  File "/Users/gonzo/Documents/dev/zipline-reloaded/src/zipline/data/adjustments.py", line 23, in <module>
    from ._adjustments import load_adjustments_from_sqlite
  File "src/zipline/data/_adjustments.pyx", line 1, in init zipline.data._adjustments
    #
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disable if you are certain you don't need it).

@stefan-jansen
Copy link
Owner

Should be addressed by #264

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

Successfully merging this pull request may close these issues.

2 participants