. Advertisement .
..3..
. Advertisement .
..4..
When you set up any package and find the warning message in Python, it shows “Defaulting to user installation because normal site-packages is not writeable” text. Do you check the python version or location? If you would like to understand this issue, let’s consider our recommendation here. Below simple suggestions would be a great explanation that you have ever found.
Where does it come from?
Python is used for software development, web development (server-side), mathematics and system scripting. Python is a popular programming language so error for installing any package is common.
Let search what is your trouble when you are struggling to install the package. You have been having several permission problems. VSCode can’t find Jupyter Notebook, pip
installs packages at ~/Library/Python/3.7/site-packages.
When you use which python3
you get usr/bin/python3
. When you apply pip3 install <package>.
Then, you get this warning message:
Defaulting to user installation because normal site-packages is not writeable
Thus, it shows that this is a permission issue, pip
can not install to the python of “base” , & python
can not find what you have installed into ~/Library/Python/3.7/site-packages
.
Don’t worry too much and find the best solution for your problem as below
How do you fix the error Defaulting to user installation because normal site-packages is not writeable Python?
To correct Defaulting to user installation because normal site-packages is not writeable Python you should follow our recommnedation and the passage “Defaulting to user installation because normal site-packages is not writeable” does not pop up and the function looks to work just fine.
Solution 1: The python need be Reinstalled
At the beginning, just removed and reinstalled the python. Your system is well-functioning and the text “Defaulting to user installation because normal site-packages is not writeable” doesn’t appear anymore.
Solution 2: Modify the download the python’s location
- Just try to adjust the download python’s location
- Run cmd as admin. Or change the download python’s location and run cmd as without admin. Try both ways
Solution 3: Make sure to update the Python version
Check the python version is up –to-date, if it is not, just update the new version.
Solution 4: Operate python version when you install the package
When you are installing a package, you should apply Python version.
Python 3:
python3 -m pip install [package_name]
Python 3.7:
python3.7 -m pip install [package_name]
Python 2:
python -m pip install [package_name]
Solution 5: Install the Virtual Environment
- In Python, install Virtual Environment Module
$ pip install virtualenv
- Verify if the Virtual environment is installed properly by checking its version
$ virtualenv --version
- Create a new virtual environment for your project
$ virtualenv my_name
After that, a directory named my_name will be created. This directory includes all executables needed to run the programs that an Python project might require. This is the location where Python packages are installed.
- Specify the Python interpreter
$ virtualenv -p /usr/bin/python3 virtualenv_name
- Activate the Virtual Environment
$ source virtualenv_name/bin/activate
In conclusion
We hope you enjoyed our article about Python as showed. With this knowledge, we comprehend that you can correct the “Defaulting to user installation because normal site-packages is not writeable” error simply by our brilliant approaches. If you have other good ideas or concerns, please send us your comments in the box below.
Leave a comment