Как сделать python3.6 по умолчанию в Ubuntu 14.04 - PullRequest
0 голосов
/ 02 июля 2019

В Ubuntu 14.04 установлено 3 версии Python 2.7 / 3.4 / 3.6;

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

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.
>>>

Я хочу сделать Python 3.6 по умолчанию. Как мне это сделать? Во-вторых, поскольку 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...

Любая помощь очень ценится.

Я вижу символические ссылки 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

1 Ответ

0 голосов
/ 02 июля 2019

На самом деле это сработало;

$ 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
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...