我成功地安装了Python3 3‘S Pip和SetupTool软件包:
sudo apt-get install python3-pip但是,当我试图通过以下方式下载/安装Python3的任何软件包时:
pip install <package-name>上面说我没有python-pip。它看起来像操作系统的默认是Python2,但我不想使用它或安装包为它。如何使用已安装的Python3-pip并将系统的默认值更改为Python3?
PS:我应该卸载Ubuntu的默认Python2吗?能帮上忙吗?
发布于 2015-05-28 20:36:40
Python3的
Python3版本的pip是pip3,因此您可以运行:
pip3 install <package-name>通常,您可以使用dpkg选项运行-L, --list,以查看安装的包中有哪些文件:
dpkg -L python3-pip我刚刚安装了python3-pip来验证这一点,列出的文件之一是/usr/bin/pip3。
这两个版本的Python可以非常愉快地共存。
我不建议卸载Ubuntu附带的Python 2,因为它是有用的工具和重要的OS实用程序所需要的。有一个Debian项目将其Python2OS代码移植到Python3,但它们需要一段时间才能完成。
作为一个实验,我尝试运行sudo apt-get remove python,并被要求确认是否要卸载一长串软件包:
apturl blueman flashplugin-installer gconf2 gdebi gecko-mediaplayer gimp gir1.2-ibus-1.0 gksu gnome-mplayer gvfs-backends ibus inkscape iotop ipython libgda-5.0-4 libgda-5.0-common libgksu2-0
libgnomevfs2-0 libgnomevfs2-common libgnomevfs2-extra libsmbclient light-locker-settings lubuntu-desktop lubuntu-software-center mplayer2 ndiff offlineimap pidgin python python-apt python-aptdaemon
python-aptdaemon.gtk3widgets python-bs4 python-cairo python-chardet python-colorama python-crypto python-dateutil python-dbus python-debian python-decorator python-defer python-dev python-distlib
python-gi python-gi-cairo python-glade2 python-gobject python-gobject-2 python-gtk2 python-gudev python-html5lib python-imaging python-ldb python-lxml python-matplotlib python-mock
python-ndg-httpsclient python-nose python-notify python-ntdb python-numpy python-openssl python-pexpect python-pil python-pip python-pkg-resources python-psutil python-pyasn1 python-pyparsing
python-pysqlite2 python-requests python-samba python-scipy python-setuptools python-simplegeneric python-six python-sqlite python-talloc python-tdb python-tk python-tz python-urllib3 python-wheel
python-xdg python3-smbc samba-common-bin samba-libs smbclient system-config-printer-common system-config-printer-gnome transmission-gtk ubuntu-release-upgrader-gtk update-manager update-notifier
update-notifier-common vlc-plugin-samba不用说,我没有证实。
https://unix.stackexchange.com/questions/206187
复制相似问题