Code Monkey home page Code Monkey logo

Comments (7)

calvinfo avatar calvinfo commented on May 30, 2024

can you try calling identify? want to make sure it's not a typo :)

otherwise, can you first enable analytics.debug = True and then copy the output?

from analytics-python.

mojowen avatar mojowen commented on May 30, 2024

Getting this too:

>>> import analytics

>>> analytics.write_key = 'xxxxx'
>>> analytics.debug = True

>>> user_id = 21

>>> analytics.track(user_id, "Completed Order", {'price': 50})
No handlers could be found for logger "segment"

from analytics-python.

murielsilveira avatar murielsilveira commented on May 30, 2024

I was getting the same error and I just figured out what was going on by using the development settings in the documentation:

https://segment.com/docs/libraries/python/#development-settings

Then I realized the mistake I was making.
Hope this helps.

def on_error(error, items):
    print("An error occurred:", error)

import analytics
analytics.debug = True
analytics.on_error = on_error

from analytics-python.

calvinfo avatar calvinfo commented on May 30, 2024

Closing for now, let me know if I should re-open!

from analytics-python.

salvador-dali avatar salvador-dali commented on May 30, 2024

@calvinfo can you please reopen this one.

import analytics
print analytics.__version__

analytics.write_key = "XXX"
def on_error(error, items):
    print("An error occurred:", error)

analytics.debug = True
analytics.on_error = on_error

analytics.track('019mr8mf4r', 'Made a Comment', {
    'that_aided': 'No-One',
    'comment': 'its 4AM!'
})

gives me the same error:

No handlers could be found for logger "segment"
1.1.0

from analytics-python.

calvinfo avatar calvinfo commented on May 30, 2024

Hey @salvador-dali you'll need to add a handler for the segment logger to get it to output messages properly. We should add it to our docs as well, but in that case it likely means that your call went through successfully. If you call analytics.flush() you should be guaranteed to see it.

To get rid of the handler message, do something like this:

import logger

log = logging.getLogger('segment')
log.addHandler(...)

Where you add whatever your handler is.

from analytics-python.

salvador-dali avatar salvador-dali commented on May 30, 2024

@calvinfo thanks for a quick reply. This solved my problem.

from analytics-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.