Forums

Issue with bash - problem with installing packages and python version

Hello,

I am trying to install python packages via bash and pip. I have errors and it shows it an old 2.7. How can i solve it and upgrade to 3.7?

thanks

[edited by admin: code formatting]

----------------------------------------
  ERROR: Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Failed to build llvmlite
Installing collected packages: llvmlite, numba
    Running setup.py install for llvmlite ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-NMmOAr/llvmlite/setup.
py'"'"'; __file__='"'"'/tmp/pip-install-NMmOAr/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().re
place('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-Ge8WfR/insta
ll-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-NMmOAr/llvmlite/
    Complete output (10 lines):
    running install
    running build
    got version from file /tmp/pip-install-NMmOAr/llvmlite/llvmlite/_version.py {'version': '0.32.1', 'full': 'aa11b129c0b5597306742239782
1ae6d44fa5e70'}
    running build_ext
    /usr/local/bin/python2.7 /tmp/pip-install-NMmOAr/llvmlite/ffi/build.py
      File "/tmp/pip-install-NMmOAr/llvmlite/ffi/build.py", line 122
        raise ValueError(msg.format(_ver_check_skip)) from e
                                                         ^
    SyntaxError: invalid syntax
    error: command '/usr/local/bin/python2.7' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/p
ip-install-NMmOAr/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-NMmOAr/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',
 open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --re
cord /tmp/pip-record-Ge8WfR/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

To use Python 3.7 in the Bash console you need to invoke it explicitly: python3.7 or create a vritual environment with this version of Python. Python defaults to 2.7 in our consoles since it is the default Python in Ubuntu.

Hi, How do you do this ?

thanks

@Retax Do what?