pip/python: normal site-packages is not writeable

前端 未结 5 1802
迷失自我
迷失自我 2020-12-09 03:05

I have a new Macbook - a user installed it, and then I installed a new user (mine), granted admin privileges and deleted the old one. I am on OS Catalina.

Since the

5条回答
  •  一整个雨季
    2020-12-09 03:25

    It's best to not use the system-provided Python directly. Leave that one alone since the OS can change it in undesired ways, as you experienced.

    The best practice is to configure your own Python version(s) and manage them on a per-project basis using virtualenv (for Python 2) or venv (for Python 3). This eliminates all dependency on the system-provided Python version, and also isolates each project from other projects on the machine.

    Each project can have a different Python point version if needed, and gets its own site_packages directory so pip-installed libraries can also have different versions by project. This approach is a major problem-avoider.

提交回复
热议问题