How do I find out what Python libraries are installed on my Mac?

后端 未结 7 2847
后悔当初
后悔当初 2021-02-19 20:25

I\'m just starting out with Python, and have found out that I can import various libraries. How do I find out what libraries exist on my Mac that I can import? How do I find out

7条回答
  •  逝去的感伤
    2021-02-19 20:51

    Every standard python distribution has these libraries, which cover most of what you will need in a project.

    In case you need to find out if a library exists at runtime, you do it like this

    try:
        import ObscureModule
    except ImportError:
        print "you need to install ObscureModule"
        sys.exit(1) # or something like that
    

提交回复
热议问题