Ubuntu 14.04安装了2.7 / 3.4 / 3.6的3个python版本;
$ 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
答案 0 :(得分:0)
实际上这可行;
$ 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