In Python, the error message "Defaulting to user installation because normal site-packages is not writeable" usually appears when you try to install packages without having the necessary permissions to write to the system-wide site-packages directory.
Occurrence
This commonly occurs in virtual environments or when you lack administrative access.
Error-resolving approaches
To resolve this error, you can use the following approaches:
- Using a virtual environment
First, create a virtual environment using tools like venv or virtualenv using this command in your terminal:
Now, activate the virtual environment using these commands:
Finally, install packages within the virtual environment using this command in your terminal:
This way, you will have write access to the virtual environment's site-packages directory without requiring system-wide permissions.
- Specifying a user installation
You can install the package in the user’s local site-packages directory using this command:
Use the --user flag when installing packages to specify a user installation instead of a system-wide installation.
- Using a package manager
If you're using Linux, you can use system-wide package management like apt or yum to install Python packages. Typically, administrative rights are needed for this.
Hence, these approaches provide you with the necessary write permissions to install packages in a controlled and isolated manner.
ref : https://www.educative.io/answers/how-to-resolve-normal-site-packages-is-not-writable-in-python
'프로그래밍(Programming) > Python' 카테고리의 다른 글
Python : 내장함수 (0) | 2018.05.16 |
---|---|
collections.Counter 빈도 수, 최빈값 구하기 (0) | 2016.11.14 |
파이썬 matplotlib 설치 하는 법 (0) | 2016.11.11 |
Python - map (0) | 2016.11.11 |
Python의 계산성능 향상을 위해 Fortran, C, CUDA-C, OpenCL-C 와 연동하기 - PyCon Korea 2015 - 김기환 (수치 예보) (0) | 2016.11.11 |