segmentio/analytics-python

Import analytics clash with standard library module

terra-alex opened this issue · 3 comments

Guidelines need to be change from the example mentioning to write

import analytics

This clashes with python's standard library module also called analytics, and seems to be causing an issue on segment analytics 2.2.1 & Python 3.9.7

Instead, guidelines should be to use

import segment.analytics as analytics

Just caused an issue on production build for our application

@terra-alex Thank you for the request. We will confirm and update the docs accordingly.

The docs have been updated, thank you!

Hey @nd4p90x @MichaelGHSeg ! Just realized that this can be rewritten more easily as

from segment import analytics

which makes more sense even 😅 sorry about that!