我正在研究树莓派 3B+。我想将 python 从 2.7 升级到 3.6。
我下载了提取的 python 3.6 并制作了它,但是它安装在/usr/local/bin.
这次我试图通过指定./configure --prefix=/usr前缀再次制作它,但是制作给出了一个追溯错误。
我也尝试过update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2这有助于更改 python 的版本。
但是,这样做之后,我的 pip 现在不起作用了。我在/usr/local/bin:pip,pip2.7,pip3,pip3.5,pip3.6.
我尝试删除 pip 以便我可以使用sudo apt-get remove python-pip它重新安装它,但它给出了以下错误:
pi@raspberrypi:/usr/local/bin $ sudo apt-get remove python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libpython-all-dev python-all python-all-dev python-keyring
python-keyrings.alt python-secretstorage python-wheel
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
python-pip
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
1 not fully installed or removed.
After this operation, 671 kB disk space will be freed.
Do you want to continue? [Y/n] y
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 29, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
(Reading database ... 138007 files and directories currently installed.)
Removing python-pip (9.0.1-2+rpt2) ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
我只想拥有带有功能 pip 的 python 3.6 和 2.7(因为我已经在 2.7 上安装了库)。
桃花长相依
暮色呼如
相关分类