Conda defaulting to user installation because normal site-packages is not writeable

[2021.07.07]  인턴 +128  How to install python module package in linux? (+solve : "Defaulting to user installation because normal site-packages is not writeable")

-> 해당 게시글은 AWS EC2에서 yum 모듈을 통해 pip를 설치 하는 방법이 게시되어 있다.

이번 게시글은,  pip를 통해 python 모듈을 설치하는 방법에 대해서 알아보자.

당연하게도, pip install requests 로 설치를 시도 하였다.

하지만 아래와 같은 에러메세지가 발생함.

---------------------------------------------------------------------------------------------------------------------------

-> 위와 같은 방법으로 파이썬 모듈 패키지를 다운해보자.

-> python3 에 requests 모듈이 정상적으로 설치되어 실행된 것을 확인할 수 있다.

rishitghoshPosts: 33Joined: Thu Dec 21, 2017 7:06 am

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

Hi....

I ran these 2 commands in the command line -
python -m pip install -U pip
python -m pip install -U pip numpy

At the starting it shows
"Defaulting To User Installation Because Normal Site-packages Is Not Writeable"
But after this it shows the package is installed.
But when I try to important numpy in thonny python IDE it shows an error.


klricksPosts: 8423Joined: Sat Jan 12, 2013 3:01 amLocation: Grants Pass, OR, USA

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

Mon Apr 27, 2020 6:33 pm

rishitghosh wrote: ↑

Mon Apr 27, 2020 6:00 pm

Hi....

I ran these 2 commands in the command line -
python -m pip install -U pip
python -m pip install -U pip numpy

At the starting it shows
"Defaulting To User Installation Because Normal Site-packages Is Not Writeable"
But after this it shows the package is installed.
But when I try to important numpy in thonny python IDE it shows an error.

Thonny uses Python 3 and your commands are for Python 2
Use python3 and pip3

Code: Select all

python3 -m pip3 install -U pip3 python3 -m pip3 install -U pip3 numpy

Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.




Return to “Python”

On: March 11, 2022 Views: 2k Author: tptutoria

  • Where does it come from?
  • How do you fix the error Defaulting to user installation because normal site-packages is not writeable Python?
    • Solution 1: The python need be Reinstalled
    • Solution 2: Modify the download the python’s location
    • Solution 3: Make sure to update the Python version
    • Solution 4: Operate python version when you install the package
    • Solution 5: Install the Virtual Environment
  • In conclusion

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

  1. Just try to adjust the download python’s location
  2. 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 
  • Verify if the Virtual environment is installed properly by checking its version
  • Create a new virtual environment for your project

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.