Search code examples
pythonpycharmsite-packages

What does it mean to "Inherit global site-packages" in PyCharm?


When creating a new Python project, why would I want to select this option? If I don't select it, what functionality am I missing out on? Would I not be able to import certain Python modules?


Solution

  • It's just an option to pre-install some packages that you're using everytime, or if it doesn't bother you to have extra packages in your local python interpreted

    • select it : all packages installed in the global python of your machine will be accessible for the interpreter you're going to create in the virtualenv.
    • do not select it : the interpreter you're going to create in the virtualenv will just have the basic, like pip, and setuptools, then you can install just what you need

    Python global and venv :

    • The global python, is the one in /usr/bin in Linux, or wherever in Windows, this is the main installation of the program, and you can add extra packages using pip

    • When you're working on something, you may need only some packages, or specific version so not using the global Python. You can create a virtualenv, or pyenv, that will link a local python to the global one, for the main python functionnality, but the packages will be installed only in the virtualenv (and when using Pycharm, it can install for you the main package into the virtualenv you're creating)