2023. 11. 21. 17:37ㆍ서버 프로그래밍
Ubuntu에 Python 버전이 여러개 설치 되어 있을 경우, 처리하는 방법
https://seongkyun.github.io/others/2019/05/09/ubuntu_python/
https://iohk.zendesk.com/hc/en-us/articles/16724475448473-Install-Python-3-11-on-ubuntu
https://roeldowney.tistory.com/522
Notice you're running python3 -m pip install --upgrade pip before running update-alternatives.
This means you upgraded pip to the latest 23.2.1 for Python 3.10, but for Python 3.11 the apt-provided pip 22.0.2 is still used.
https://github.com/giampaolo/psutil/issues/2301
The reason might be that you saved the file on Windows, with CR LF as the line ending (\r\n).
Run the following command in your terminal:
sed -i -e 's/\r$//' scriptname.sh
(Of course, change scriptname.sh to your file name)
The command will replace those CR characters with nothing, which will leave these lines with LF (\n) as the ending, and Bash will be able to read and execute the file by running
./scriptname.sh