TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'

Hey Im new to using zipline. I am trying to run one of the examples and getting an error when importing using jupyter notebook via install in conda.

Is this module dated or am I doing something wrong? Thanks!

from zipline.api import order_target, record, symbol


TypeError Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 from zipline.api import order_target, record, symbol

File C:\ProgramData\Anaconda3\lib\site-packages\zipline_init_.py:21, in
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 trading_calendars import get_calendar
23 from . import data
24 from . import finance

File C:\ProgramData\Anaconda3\lib\site-packages\trading_calendars_init_.py:16, in
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 .trading_calendar import TradingCalendar
17 from .calendar_utils import (
18 clear_calendars,
19 deregister_calendar,
(…)
25 resolve_alias,
26 )
28 all = [
29 ‘clear_calendars’,
30 ‘deregister_calendar’,
(…)
37 ‘TradingCalendar’,
38 ]

File C:\ProgramData\Anaconda3\lib\site-packages\trading_calendars\trading_calendar.py:33, in
30 from pandas.tseries.offsets import CustomBusinessDay
31 import toolz
—> 33 from .calendar_helpers import (
34 NP_NAT,
35 compute_all_minutes,
36 next_divider_idx,
37 previous_divider_idx,
38 )
39 from .utils.memoize import lazyval
40 from .utils.pandas_utils import days_at_time

File C:\ProgramData\Anaconda3\lib\site-packages\trading_calendars\calendar_helpers.py:6, in
2 import pandas as pd
4 NANOSECONDS_PER_MINUTE = int(6e10)
----> 6 NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
9 def next_divider_idx(dividers, minute_val):
11 divider_idx = np.searchsorted(dividers, minute_val, side=“right”)

TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NaTType’

in the conda CMD if I simply enter the command ‘zipline’ I get an identical error:

I just updated to conda 4.13.0 tonight, maybe thats why its throwing the error?

Had the same issue…googled it, and the following hack worked, yet not really sure why…so use with discretion!

In file:
/miniconda3/envs/zrl/lib/python3.8/site-packages/trading_calendars/calendar_helpers.py

Change:
#new NP_NAT = np.array([pd.NaT])
# orig NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
# ajjc old issue #40 2022-08-09
NP_NAT = np.array([pd.NaT.asm8.view(‘i8’)], dtype=np.int64)[0]

alan