{"id":241,"hash":"234c8d722611b32406237247b47996c979eb400db79006ba2116d26c9530fe54","pattern":"Could not install packages due to an EnvironmentError: [Errno 13]","full_message":"In my MacOS Mojave terminal I wanted to install a python package with pip. At the end it says:\n\nYou are using pip version 10.0.1, however version 18.1 is available.\nYou should consider upgrading via the 'pip install --upgrade pip' command.\n\nSo I wanted to update pip with the given command but I got an error:\n\nCould not install packages due to an EnvironmentError: [Errno 13] Permission denied: \n'/Library/Python/2.7/site-packages/pip-18.0-py2.7.egg/EGG-INFO/PKG-INFO'\nConsider using the `--user` option or check the permissions.\n\nI don't really understand what to do now. Also I realized it says Python 2.7 in the error message but I have and want to use only python 3.","ecosystem":"pypi","package_name":"macos","package_version":null,"solution":"If you want to use python3+ to install the packages you need to use pip3 install package_name\n\nAnd to solve the errno 13 you have to add --user at the end\n\npip3 install package_name --user\n\nEDIT:\n\nFor any project in Python it's highly recommended to work on a Virtual environment, which is a tool that helps to keep dependencies required by different projects separate by creating isolated Python virtual environments for them.\n\nIn order to create one with python3+ you have to use the following command:\n\nvirtualenv enviroment_name -p python3\n\nAnd then you work on it just by activating it:\n\nsource enviroment_name/bin/activate\n\nOnce the virtual environment is activated, the name of your virtual environment will appear on the left side of the terminal. This will let you know that the virtual environment is currently active.\nNow you can install dependencies related to the project in this virtual environment by just using pip.\n\npip install package_name","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/52949531/could-not-install-packages-due-to-an-environmenterror-errno-13","votes":270,"created_at":"2026-04-19T04:41:35.782200+00:00","updated_at":"2026-04-19T04:51:47.831138+00:00"}