플랫폼을 작동하지 : 우분투 17.04 서버 설치가 파이썬 2.7 및 파이썬 3.5을 포함lsb_release 소스에서 파이썬 3.6.3을 설치 한 후
우분투 17.04 서버. 소스에서 수동으로 Python 3.6.3을 설치했습니다. 그러나, lsb_release -a
실패 :
[email protected]:~# lsb_release -a
Traceback (most recent call last):
File "/usr/bin/lsb_release", line 25, in <module>
import lsb_release
ModuleNotFoundError: No module named 'lsb_release'
하지만 #!/usr/bin/python3.5 -Es
에
#!/usr/bin/python3 -Es
에서 파일 lsb_release의 첫 번째 줄을 수정하면 그것은 다시 작동합니다.
python3.5
[email protected]:~# python3.5
Python 3.5.3 (default, Sep 14 2017, 22:58:41)
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
>>> import lsb_release
>>> exit()
python3
[email protected]:~# python3
Python 3.6.3 (default, Oct 14 2017, 20:35:42)
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/root/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/site-packages']
>>> import lsb_release
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'lsb_release'
>>> exit()
사람이 그것을 해결하는 방법을 알고 않습니다 여기
[email protected]:~# lsb_release -a
LSB Version: core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
는 모듈 검색 경로입니까? 감사.
왜 PPA에서 Python 3.6을 설치하지 않았습니까? –
'make altinstall '대신에'make install'을 사용하신 것 같습니다. (https://docs.python.org/3.6/using/unix.html#building-python 참조). 파이썬 3 심볼릭 링크를 가리켜 복구 할 수있다.5 바이너리이지만 전체 OS를 다시 설치해야 할 수도 있습니다. – snakecharmerb