vifactor / repostat

Inspired by gitstats project: git repository desktop analyzer
GNU General Public License v3.0
106 stars 13 forks source link

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

Open chahank opened 3 years ago

chahank commented 3 years ago

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'
vifactor commented 3 years ago

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.

chahank commented 3 years ago

Thanks, with python 3.8.5 it worked!

pulkomandy commented 2 years ago

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.