我以某种方式设法在运行最新版本Raspbian(Debian Jessie-armv71)的Raspberry Pi 3上真正安装了Python。
这是我尝试调用Python时得到的:
root@xxx:~# python Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 563, in <module>
main() File "/usr/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths) File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
user_site = getusersitepackages() File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE File "/usr/lib/python2.7/site.py", line 237, in getuserbase
USER_BASE = get_config_var('userbase') File "/usr/lib/python2.7/sysconfig.py", line 582, in get_config_var
return get_config_vars().get(name) File "/usr/lib/python2.7/sysconfig.py", line 528, in get_config_vars
_init_posix(_CONFIG_VARS) File "/usr/lib/python2.7/sysconfig.py", line 412, in _init_posix
from _sysconfigdata import build_time_vars File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_nd import * ImportError: No module named _sysconfigdata_nd
尝试通过apt-get产量删除Python:
> root@xxx# apt-get remove python Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libegl1-mesa libgbm1 libgles2-mesa libjs-excanvas libmtdev1 libpython-dev libpython2.7-dev libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5sql5 libqt5sql5-sqlite libqt5webkit5 libqt5widgets5 libqt5x11extras5 libwayland-client0 libwayland-server0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-util0 libxcb-xkb1 libxkbcommon-x11-0 libxkbcommon0 python2.7-dev qml-module-qtquick-controls qml-module-qtquick-dialogs qml-module-qtquick-layouts qml-module-qtquick-privatewidgets qml-module-qtquick-window2 qml-module-qtquick2 qttranslations5-l10n Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: python python-cffi python-chardet python-colorama python-cryptography python-dev python-distlib python-html5lib python-m2crypto python-ndg-httpsclient python-openssl python-pip python-pkg-resources python-ply python-pyasn1 python-pycparser python-requests python-setuptools python-six python-support python-urllib3 python-wheel 0 upgraded, 0 newly installed, 22 to remove and 0 not upgraded. 16 not fully installed or removed. Need to get 0 B/1,037 kB of archives. After this operation, 8,436 kB disk space will be freed. Do you want to continue? [Y/n] y WARNING: The following packages cannot be authenticated! dh-python python3 python3-pkg-resources python3-chardet python3-colorama python3-distlib python3-six python3-html5lib python3-urllib3 python3-requests python3-setuptools python3-pip python3-virtualenv python3-wheel Install these packages without verification? [y/N] y (Reading database ... 121984 files and directories currently installed.) Removing python-ndg-httpsclient (0.3.2-1) ... Removing python-support (1.0.15) ... Removing python-wheel (0.24.0-1) ... Removing python-pyasn1 (0.1.7-1) ... Removing python-pip (1.5.6-5) ... Removing python-requests (2.4.3-6) ... Removing python-urllib3 (1.9.1-3) ... Removing python-openssl (0.14-1) ... Removing python-cryptography (0.6.1-1+deb8u1) ... Removing python-cffi (0.8.6-1) ... Removing python-chardet (2.3.0-1) ... Removing python-colorama (0.3.2-1) ... Removing python-dev (2.7.9-1) ... Removing python-distlib (0.1.9-1) ... Removing python-html5lib (0.999-3) ... Removing python-m2crypto (0.21.1-3) ... Removing python-setuptools (5.5.1-1) ... Removing python-pkg-resources (5.5.1-1) ... Removing python-pycparser (2.10+dfsg-3) ... Removing python-ply (3.4-5) ... Removing python-six (1.8.0-1) ... Removing python (2.7.9-1) ... Processing triggers for man-db (2.7.5-1~bpo8+1) ... dpkg: error processing package python3 (--configure): package is in a very bad inconsistent state; you should reinstall it before attempting configuration dpkg: dependency problems prevent configuration of python3-pkg-resources: python3-pkg-resources depends on python3:any (>= 3.3); however: Package python3 is not configured yet. python3-pkg-resources depends on python3:any (<< 3.5); however: Package python3 is not configured yet.
dpkg: error processing package python3-pkg-resources (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python-chardet-whl: python-chardet-whl depends on python3-pkg-resources; however: Package python3-pkg-resources is not configured yet.
dpkg: error processing package dh-python (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3 python3-pkg-resources python-chardet-whl python-pip-whl python3-chardet python3-colorama python3-distlib python3-six python3-html5lib python3-urllib3 python3-requests python3-setuptools python3-pip python3-virtualenv python3-wheel dh-python
我已经搜索了所有stackoverflow并尝试了许多推荐的解决方案,但仍然无法解决此问题。非常感谢您提供有关如何解决此问题的帮助或协助。