简体   繁体   English

如何在ubuntu 14.04上将python3.6设置为默认值

[英]How to make python3.6 as default on ubuntu 14.04

Ubuntu 14.04 has 3 python versions installed 2.7/3.4/3.6; Ubuntu 14.04具有3个安装了2.7 / 3.4 / 3.6的python版本;

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty

python3 runs 3.4 by default. python3默认运行3.4。

$ python3
Python 3.4.3 (default, Nov 28 2017, 16:41:13)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

I want to make python 3.6 as default. 我想将python 3.6设置为默认值。 How can I do it? 我该怎么做? Secondly, since python3.4 is default, pip3 uses it and is failing to install slackclient module which is more concerning 其次,由于python3.4是默认设置,因此pip3会使用它,并且无法安装slackclient模块,这更值得关注

$ sudo pip3 install slackclient
Downloading/unpacking slackclient
  Downloading slackclient-2.1.0-py2.py3-none-any.whl (51kB): 51kB downloaded
Downloading/unpacking aiohttp>3.5.2 (from slackclient)
  Downloading aiohttp-3.5.4.tar.gz (1.1MB): 1.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/aiohttp/setup.py) egg_info for package aiohttp
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/aiohttp/setup.py", line 13, in <module>
        raise RuntimeError("aiohttp 3.x requires Python 3.5.3+")
    RuntimeError: aiohttp 3.x requires Python 3.5.3+
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/aiohttp/setup.py", line 13, in <module>

    raise RuntimeError("aiohttp 3.x requires Python 3.5.3+")

RuntimeError: aiohttp 3.x requires Python 3.5.3+

----------------------------------------
Cleaning up...

Any help is much appreciated. 任何帮助深表感谢。

I see python3 symlinks to python3.4, not sure if changing that will help as this is a production system so I don't want to do anything I don't know about. 我看到python3符号链接到python3.4,不确定更改是否会有所帮助,因为这是生产系统,所以我不想做我不知道的事情。

/usr/bin$ ls -l python3.4*
-rwxr-xr-x 2 root root 3714088 Nov 28  2017 python3.4
lrwxrwxrwx 1 root root      33 Nov 28  2017 python3.4-config -> x86_64-linux-gnu-python3.4-config
-rwxr-xr-x 2 root root 3714088 Nov 28  2017 python3.4m
lrwxrwxrwx 1 root root      34 Nov 28  2017 python3.4m-config -> x86_64-linux-gnu-python3.4m-config

Actually this worked; 实际上,这有效;

$ sudo pip3 install --upgrade pip
Downloading/unpacking pip from https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl#sha256=993134f0475471b91452ca029d4390dc8f298ac63a712814f101cd1b6db46676
  Downloading pip-19.1.1-py2.py3-none-any.whl (1.4MB): 1.4MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Not uninstalling pip at /usr/lib/python3/dist-packages, owned by OS
Successfully installed pip
Cleaning up...
$ sudo pip3 install slackclient
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
WARNING: The directory '/home/blah/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/home/blah/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting slackclient
  Downloading https://files.pythonhosted.org/packages/7c/2f/9b6db4c7686be3dc6b4244eaef4f37226a2ccca1a796516d4adcdfeefe56/slackclient-1.3.2.tar.gz
Collecting websocket-client<0.55.0,>=0.35 (from slackclient)
  Downloading https://files.pythonhosted.org/packages/26/2d/f749a5c82f6192d77ed061a38e02001afcba55fe8477336d26a950ab17ce/websocket_client-0.54.0-py2.py3-none-any.whl (200kB)
     |████████████████████████████████| 204kB 2.3MB/s
Requirement already satisfied: requests<3.0a0,>=2.11 in /usr/local/lib/python3.4/dist-packages (from slackclient) (2.13.0)
Requirement already satisfied: six<2.0a0,>=1.10 in /usr/local/lib/python3.4/dist-packages (from slackclient) (1.10.0)
Building wheels for collected packages: slackclient
  Building wheel for slackclient (setup.py) ... done
  Stored in directory: /home/blah/.cache/pip/wheels/3b/d4/92/3458f0e1a3e1a9c8935d3b2db89a75d74d8d45601fedec752f
Successfully built slackclient
Installing collected packages: websocket-client, slackclient
Successfully installed slackclient-1.3.2 websocket-client-0.54.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM