How to check whether virtualenv was created with '--no-site-packages'?

前端 未结 3 1777
半阙折子戏
半阙折子戏 2020-12-31 04:29

Sometimes I get errors that I suspect are the result of my Django app using globally installed Python modules/Django apps instead of those within its virtualenv.

Is

3条回答
  •  悲&欢浪女
    2020-12-31 04:46

    An easy way is opening the interactive python shell and executing import somemodule; print somemodule and then check the path from where that module was imported.

    >>> import flask; print flask
    
    

    vs.

    >>> import flask; print flask
    
    

提交回复
热议问题