When I try to install pandas on an EC2 instance in the same way as in the local environment, I get an error and cannot proceed.
Two errors occur. ① Memory Error: Error without memory ② PermissionError: Error without permission
Memory error
$ pip3 install pandas
MemoryError
Unauthorized error
$ pip3 --no-cache-dir install pandas
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7'
Installation is completed successfully with the following one sentence.
python
$ sudo pip3 --no-cache-dir install pandas
#Successful installation
Successfully installed numpy-1.18.4 pandas-1.0.3
python-dateutil-2.8.1 pytz-2020.1 six-1.15.0
** ① How to deal with Memory Error **
Add the --no-cache-dir
option.
--The behavior of pip is to read the entire file into memory and then try to execute it, so an error occurs due to insufficient memory. --By adding the above option, cache is avoided.
** ② How to deal with Permission Error **
Execute with proxy privileges with the sudo
command.
Recommended Posts