repostat icon indicating copy to clipboard operation
repostat copied to clipboard

AttributeError: type object 'type' has no attribute 'now'

Open chahank opened this issue 4 years ago • 3 comments

I got the error below after executing repostat ./git_repo ./gitstat_output , is there a simple solution? Thank!

File "/Users/ck/opt/anaconda3/envs/git_stats/lib/python3.9/site-packages/analysis/repostat.py", line 52, in main
    report.create(output_path)
  File "/Users/ck/opt/anaconda3/envs/git_stats/lib/python3.9/site-packages/report/htmlreportcreator.py", line 140, in create
    self.make_activity_page(),
  File "/Users/ck/opt/anaconda3/envs/git_stats/lib/python3.9/site-packages/report/htmlreportcreator.py", line 202, in make_activity_page
    page.add_plot(self.make_activity_plot())
  File "/Users/ck/opt/anaconda3/envs/git_stats/lib/python3.9/site-packages/report/htmlreportcreator.py", line 207, in make_activity_plot
    recent_activity = self._get_recent_activity_data()
  File "/Users/ck/opt/anaconda3/envs/git_stats/lib/python3.9/site-packages/report/htmlreportcreator.py", line 83, in _get_recent_activity_data
    recent_weekly_commits = self.git_repository_statistics.\
  File "/Users/ckr/opt/anaconda3/envs/git_stats/lib/python3.9/site-packages/analysis/gitrepository.py", line 152, in get_recent_weekly_activity
    today = pd.Timestamp.today()
  File "pandas/_libs/tslibs/timestamps.pyx", line 294, in pandas._libs.tslibs.timestamps.Timestamp.today
AttributeError: type object 'type' has no attribute 'now'

chahank avatar Dec 08 '20 17:12 chahank

I would suggest to try python 3.8, because anyway according to issue https://github.com/vifactor/repostat/issues/198 v.3.9 does not work.

vifactor avatar Dec 09 '20 17:12 vifactor

Thanks, with python 3.8.5 it worked!

chahank avatar Dec 10 '20 08:12 chahank

According to https://stackoverflow.com/questions/66112913/pandas-to-datetimetoday-throwing-error the issue is fixed in Pandas 1.1.3. Currently repostat uses 1.3.3 (since 1906cb61f3b447be4fd23d7e3d046284564d17c3), so it should be fine now?

If that's the case, this issue can be closed and the warning about Python 3.9 removed from the readme.

pulkomandy avatar Nov 07 '21 13:11 pulkomandy