I use the following code to install python3.10 in Ubuntu18.04.
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.10 python3.10-distutils
And then run python3.10 -c 'import sys; print(sys.path)'
python3.10 -c 'import sys; print(sys.path)'
, I got:
['', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages']
But if run python3.10 get-pip.py --disable-pip-version-check
to install pip, pip would be in /usr/lib/python3.10/site-packages
.
In debian/ubuntu, python packages would be installed in dist-packages.
/usr/lib/python[x].[y]/site-packages
should be not exists.
Use python3.10 get-pip.py --user
can solve this question.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.