Python Library Path

后端 未结 3 944
栀梦
栀梦 2020-12-24 00:19

In ruby the library path is provided in $:, in perl it\'s in @INC - how do you get the list of paths that Python searches for modules when you do a

3条回答
  •  难免孤独
    2020-12-24 00:35

    You can also make additions to this path with the PYTHONPATH environment variable at runtime, in addition to:

    import sys
    sys.path.append('/home/user/python-libs')
    

提交回复
热议问题