Symptoms
I attempted to install a Python package using this command.
pip3 install [package-name]
And then this error was thrown.
Description
- Two types of Python are used in a single MacOS machine - User-specific and System-wide packages.
- System-wide packages are shared by all the users, and even system package managers like apt. Installing user-specific packages as system-wide packages is very dangerous because it can conflict with system package managers if they run some Python scripts.
Solution
Create
path/.config/pip/pip.confand type this script.
CODE[global]
break-system-packages = true
user = true
Install
pipenvto manage dependencies per project. Thepip.conffile let the command run with--break-system-packagesand--useroptions.
CODEpip3 install pipenv
Run a file with the all project dependencies in a virtual environment
CODEpipenv run python [file-name] .py
Otherwise, you could run up a virtual environment instance and run the python file.
CODEpipenv shell
python [file-name].py
SOCIAL SHARE CARD GENERATOR