Skip to content

TypeError: unsupported operand type(s) for |: 'type' and 'type' #272

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

Open
lufq7 opened this issue Dec 7, 2024 · 0 comments
Open

TypeError: unsupported operand type(s) for |: 'type' and 'type' #272

lufq7 opened this issue Dec 7, 2024 · 0 comments

Comments

@lufq7
Copy link

lufq7 commented Dec 7, 2024

Dear Zipline Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

  • Operating System: (Windows Version 10.0.22631.4460)
  • Python Version: $ python --3.9.20
  • Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'
  • How did you install Zipline: conda install -c conda-forge zipline-reloaded
  • Python packages: $ pip freeze or $ conda list

Now that you know a little about me, let me tell you about the issue I am
having:

Description of Issue

In jupyter notebook I type:

from zipline import run_algorithm

report below:

TypeError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from zipline import run_algorithm

File ~\anaconda3\envs\zip38\lib\site-packages\zipline_init_.py:21
17 import numpy as np
19 # This is not a place to dump arbitrary classes/modules for convenience,
20 # it is a place to expose the public interfaces.
---> 21 from zipline.utils.calendar_utils import get_calendar
23 from . import data
24 from . import finance

File ~\anaconda3\envs\zip38\lib\site-packages\zipline\utils\calendar_utils.py:5
2 from functools import partial
4 import pandas as pd
----> 5 from exchange_calendars import ExchangeCalendar as TradingCalendar
6 from exchange_calendars import clear_calendars
7 from exchange_calendars import get_calendar as ec_get_calendar # get_calendar,

File ~\anaconda3\envs\zip38\lib\site-packages\exchange_calendars_init_.py:16
1 #
2 # Copyright 2018 Quantopian, Inc.
3 #
(...)
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
---> 16 from .calendar_utils import (
17 clear_calendars,
18 deregister_calendar,
19 get_calendar,
20 get_calendar_names,
21 register_calendar,
22 register_calendar_alias,
23 register_calendar_type,
24 resolve_alias,
25 names_to_aliases,
26 aliases_to_names,
27 )
28 from .exchange_calendar import ExchangeCalendar
30 all = [
31 "clear_calendars",
32 "deregister_calendar",
(...)
41 "ExchangeCalendar",
42 ]

File ~\anaconda3\envs\zip38\lib\site-packages\exchange_calendars\calendar_utils.py:3
1 from typing import Literal
----> 3 from .calendar_helpers import parse_date, Date
4 from .always_open import AlwaysOpenCalendar
5 from .errors import CalendarNameCollision, CyclicCalendarAlias, InvalidCalendarName

File ~\anaconda3\envs\zip38\lib\site-packages\exchange_calendars\calendar_helpers.py:24
20 NP_NAT = pd.NaT.value
22 # Use Date type where input does not need to represent an actual session
23 # and will be parsed by parse_date.
---> 24 Date = pd.Timestamp | str | int | float | datetime.datetime
26 # Use Session type where input should represent an actual session and will
27 # be parsed by parse_session.
28 Session = Date

TypeError: unsupported operand type(s) for |: 'type' and 'type'

What did I do wrong?

Sincerely,

Lufq7

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

No branches or pull requests

1 participant