这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug] Import Error: using obb.equity.price.historical() #7113

@jjfantini

Description

@jjfantini

Describe the bug
When I create a new environment with UV and add openbb to the env. Upon import and using the obb module, I get a weird Import error.

To Reproduce
Install uv and python 3.12.10 in a micromamba env
Create a uv .venv using Python in the menu environment
import obb from openbb
run obb.equity.price.historical()

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[2], line 1
----> 1 obb.equity.price.historical(
      2     symbol="AAPL",
      3     start_date="2020-01-01",
      4     end_date="2020-12-31",
      5     interval="1d",
      6 )

File ~/github/humblFINANCE-org/humblDATA/.venv/lib/python3.12/site-packages/openbb/package/__extensions__.py:127, in Extensions.equity(self)
    124 @property
    125 def equity(self):
    126     # pylint: disable=import-outside-toplevel
--> 127     from . import equity
    129     return equity.ROUTER_equity(command_runner=self._command_runner)

File ~/github/humblFINANCE-org/humblDATA/.venv/lib/python3.12/site-packages/openbb/package/equity.py:7
      5 from datetime import date
      6 from inspect import Parameter
----> 7 from typing import (
      8     TYPE_CHECKING,
      9     Annotated,
     10     Any,
     11     EquityInfo,
     12     EquityScreener,
     13     EquitySearch,
     14     ForwardRef,
     15     HistoricalMarketCap,
     16     Literal,
     17     MarketSnapshots,
     18     Optional,
     19     Union,
     20 )
     21 from warnings import simplefilter, warn
     23 import numpy

ImportError: cannot import name 'EquityInfo' from 'typing' (/Users/jjfantini/github/humblFINANCE-org/humblDATA/menv/lib/python3.12/typing.py)

Screenshots

Image

Desktop (please complete the following information):

  • Mac Sequoia
  • OpenBB 4.4.4
  • Python 3.12.10

I have this logic working on another project, what could the issue be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions