Hi linuxdev @linuxdev, I have found that the problem.
Firstly, I installed ubuntu18.04 instead of my previous ubuntu16.4, and it could use sdkmanager.
Then I installed the Anaconda which is used by python.
If I type pip3 in terminal, it would showed as following:
Traceback (most recent call last):
File “/usr/bin/pip3”, line 9, in
from pip import main
ImportError: cannot import name ‘main’ from ‘pip’ (/home/kirito/anaconda3/lib/python3.7/site-packages/pip/init.py)
I followed the way who has solved it as following:
"from pip import main " change to “from pip._internal import main”
If I type “pip3” in terminal, and it would show like this:
ine 1012, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File “/home/kirito/anaconda3/lib/python3.7/subprocess.py”, line 395, in check_output
**kwargs).stdout
File “/home/kirito/anaconda3/lib/python3.7/subprocess.py”, line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.
Then I followed the way who has solved it as following:
sudo rm /usr/bin/lsb_release
Even though I could use pip3 , the sdkmanager would show “/bin/sh: 1: lsb_release: not found” again
And I install python-pip in terminal and copy the right lsb_release from other computer to /usr/bin/.
Then edit from #!/usr/bin/python3 -Es to #!/usr/bin/python.
Now it can open sdkmanager and use pip3 successfully.
Anyway, it shows that when other meet this problem, he can check whether or not to delete lsb_release in /usr/bin/lsb_release