2

Using Ubuntu 16.04, I have a problem with python3

$ python --version
Python 2.7.12

$ sudo apt-get install python3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3 is already the newest version (3.5.1-3).
The following packages were automatically installed and are no longer 
required:
  linux-headers-4.8.0-53 linux-headers-4.8.0-53-generic
  linux-image-4.8.0-53-generic linux-image-extra-4.8.0-53-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

$ python3
bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
Zanna
  • 70,465
R.K
  • 21
  • https://askubuntu.com/questions/320996/how-to-make-python-program-command-execute-python-3 – Panther Jun 30 '17 at 18:23
  • 1
    python calls python2 , to call python 3 use python3 – Panther Jun 30 '17 at 18:24
  • 2
    Please [edit] your question to include the outputs of type python3 and readlink -f /usr/bin/python3 – steeldriver Jun 30 '17 at 18:28
  • 6
    Probably a broken system link sudo ln -s /usr/bin/python3.4 /usr/bin/python3 or similar locate your python 3 binary and link it. – Panther Jun 30 '17 at 18:30
  • so now i'm with new problem, i started python and trying to execute file i got: Exception: Traceback (most recent call last): File "/home/roaa/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/home/roaa/.local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run wb.build(autobuilding=True) File "/home/roaa/.local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "/home/roaa/.local/lib/python – R.K Jun 30 '17 at 20:47
  • @RoaaSolh if you have another terminal emulator that doesn't depend on python3 (e.g. xterm) you can start that from the launcher - alternatively, log in to a CLI virtual terminal via Ctrl-Alt-F1 thru Ctrl-Alt-F6 – steeldriver Jun 30 '17 at 20:49
  • @steeldriver i solve the problem with python and terminal is working fine ,but new problem appears when trying to execute file .py that imports numpy – R.K Jun 30 '17 at 20:50
  • 1
    @RoaaSolh if you have a new problem, start a new question – steeldriver Jun 30 '17 at 20:52
  • 2
    no man this is not duplicate as how you can do alisasing as none of the python version are working.... – Aman Gupta Apr 19 '19 at 10:57

0 Answers0