Defaulting to user installation because normal site-packages is not writeable

Are you facing difficulties in solving the error “defaulting to user installation because normal site-packages is not writeable“? Yes, you have come to the right place. Today, I will show you how to solve this error.

The error “defaulting to user installation because normal site-packages is not writeable” occurs when you install the package in the python wrong version. To solve the error, run the “python3 -m pip install <package name>” command.

Fixed: ImportError: cannot import name soft_unicode from markupsafe

When you install the package with the wrong python version, you will get an error like this:

Defaulting to user installation because normal site-packages is not writeable
Collecting numpy
  Downloading numpy-1.23.4-py2.py3-none-any.whl
Installing collected packages: numpy

The most common cause of this error is to use of the wrong version of PIP and Python. So you can solve the error with this command “python -m pip”.

# If you are using a virtual env or Python 2
python -m pip install numpy

# If you are using the Python 3
python3 -m pip install numpy

[Fixed] Defaulting to user installation because normal site-packages is not writeable

You can use the above command to get rid of this error. Or make sure you are using the correct version of Python or PIP.

If still your error is not solved you can try this method.

First, check the version of python. You can check the Python version using this command:

# Python --version

Let’s say you are using python version 3.11 you can use the command like this:

python3.11 -m pip install numpy

# If you get the permission error you can run command as admin
sudo python3.10 -m pip install numpy

If the above commands did not solve the problem, you can use the ‘–user’ option with your command. This option will install the package in the user’s home directory.

pip install <package-name> --user
pip3 install <package-name> --user

python -m pip install <package-name> --user
python3 -m pip install <package-name> --user

Conclusion on “defaulting to user installation because normal site-packages is not writeable”

Programmer, We discussed different solutions to solve the python error “Defaulting to user installation because normal site-packages is not writeable”. If you are still getting the error please let us know in the comments section. To solve the error, run the “python3 -m pip install <package name>” command

Leave a Reply