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

from backtesting import Backtest Cause AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'? #8

Open
1 task done
xaritoku opened this issue Jul 26, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xaritoku
Copy link

xaritoku commented Jul 26, 2024

Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.

  • I checked the documentation and other Issues. I am using the latest version of this library.

Version of this library.

lucit-backtesting = "^1.0.0"

Hardware?

Local server/workstation

Operating System?

Linux

Python version?

Python3.10

Installed wheel files

No response

Installed packages

No response

Logging output

No response

Issue

Hello, this is a great library for backtesting. But there's a little bit version conflict when I'm using:

Traceback (most recent call last):
  File "/builds/repo/examples/run.py", line 2, in <module>
    from backtesting import Backtest
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/backtesting/__init__.py", line 60, in <module>
    from . import lib  # noqa: F401
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/backtesting/lib.py", line 23, in <module>
    from ._plotting import plot_heatmaps as _plot_heatmaps
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/backtesting/_plotting.py", line 18, in <module>
    from bokeh.plotting import figure as _figure
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/bokeh/plotting/__init__.py", line 22, in <module>
    from . import figure as _figure ; _figure
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/bokeh/plotting/figure.py", line 25, in <module>
    from ..core.properties import (
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/bokeh/core/properties.py", line 273, in <module>
    from .property.auto import Auto; Auto
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/bokeh/core/property/auto.py", line 24, in <module>
    from .enum import Enum
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/bokeh/core/property/enum.py", line 27, in <module>
    from .primitive import String
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/bokeh/core/property/primitive.py", line 37, in <module>
    bokeh_bool_types += (np.bool8,)
  File "/root/.cache/pypoetry/virtualenvs/project-env-py3.10/lib/python3.10/site-packages/numpy/__init__.py", line 410, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?

I use poetry for version control, I just using poetry add lucit-backtesting and poetry add pandas.

Here is part of my pyproject.toml content:

[tool.poetry.dependencies]
python = "^3.10"
lucit-backtesting = "^1.0.0"
pandas = "^2.2.2"

as version resolving results, numpy version is 2.0.1,and error happens.
I can change the wrong line in site-packagaes, but in test environment, it's not a good way.
Could we update bokeh version? or there's any environment constraint files files provide?

@xaritoku xaritoku added the bug Something isn't working label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants