[英]Python 3 IDLE (Shell) but only Python 2.7 installed on Raspberry Pi?
[英]raspberry pi 4 , Python 2.7
我將最新的操作系統安裝到我的新樹莓派 4。我在 python 2.7 中的舊 rpi3 上有很多代碼,但在 python 3.9 上沒有一個代碼。 我設法在新的 RPI4 上安裝了 python 2.7,但是 PIP 遇到了很大的問題。 Python 2.7 沒有模塊。 現在是 PIP 和 PIP3 全部用於 python 3.如何將 pip 路由到 python2.7 和 pip3 到 python3.9? 我試試
sudo apt-get install pip
eading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'python3-pip' instead of 'pip'
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
The following packages were automatically installed and are no longer required:
docutils-common libfuse2 mypy pylint python3-astroid python3-asttokens
python3-docutils python3-isort python3-jedi python3-lazy-object-proxy
python3-logilab-common python3-mccabe python3-mypy python3-mypy-extensions
python3-parso python3-pygments python3-roman python3-send2trash python3-toml
python3-typed-ast python3-typing-extensions python3-wrapt sgml-base xml-core
xsel
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 198 not upgraded.
我想將請求安裝到 python 2.7
pip install requests
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.25.1)
Python 2.7 中仍然缺少模塊
謝謝
嘗試<python2.7 binary path> -m pip install requests
。 例如,在我的機器上它會是python2.7 -m pip install requests
在你的可能只是python -m pip install requests
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.