Aws ec2 defaulting to user installation because normal site packages is not writeable

I'm trying to get a new package (neopixels) onto my Raspberry Pi, which is running Python 2.7. Upon running the pip command, it says "Defaulting to user installation because normal site-packages is not writeable."

It is doing this with pretty much any package I try to install, so I know it's not a package-specific problem. It feels like a perms problem, but I don't know what I should be changing.

Thanks for any advice!

[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”

Aws ec2 defaulting to user installation because normal site packages is not writeable

I am trying to install a package in Python but I ended up with “Defaulting to user installation because normal site-packages is not writeable” error. I don’t know what’s wrong but finally I found the solution.

In this article, I am going to share the solution I found to help other developers. Okay, let’s move on to the article.

Solution 1:

The error itself tells that it can’t add/update files to the Python location. To fix this error just uninstall and reinstall Python.

If this method doesn’t work then try the second solution. You can uninstall Python via control panel.

Solution 2:

Due to some permission error on your operating for the specific Python location this error may occur. Just uninstall the Python and reinstall Python in different location.

On the Python setup wizard, you can change the installation location easily. Don’t forget to choose “Add to Path” option.

Solution 3:

Try to update the Python to the latest version. Sometimes, “Defaulting to user installation because normal site-packages is not writeable” error may occur due to old Python version.

Conclusion

I hope this article helps you to fix the error in Python. Still, If you’re having doubts please let us know via the comment section. We will help you. Share this article with other Python developers to help them.

Aws ec2 defaulting to user installation because normal site packages is not writeable

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

What does defaulting to user installation because normal site packages is not writeable mean?

The reason behind this is that you have multiple versions of Python and since you are using pip / pip3 it would try to add the packages in the default version of Python which is managed by Python and hence it will throw an error.

Where are Python packages installed?

When a package is installed globally, it's made available to all users that log into the system. Typically, that means Python and all packages will get installed to a directory under /usr/local/bin/ for a Unix-based system, or \Program Files\ for Windows.

Where does pip install?

To install modules locally, you need to create and activate what is called a virtual environment, so pip install installs to the folder where that virtual environment is located, instead of globally (which may require administrator privileges).

Does Python install pip?

PIP is automatically installed with Python 2.7. 9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments.