ubuntu为python3.6.2安装setuptools
$ wget https://files.pythonhosted.org/packages/b5/96/af1686ea8c1e503f4a81223d4a3410e7587fd52df03083de24161d0df7d4/setuptools-46.1.3.zip --no-check-certificate
$ unzip setuptools-46.1.3.zip
$ cd setuptools-46.1.3/
$ sudo python3.6 setup.py install
报错:
Traceback (most recent call last):File "setup.py", line 154, in <module>dist = setuptools.setup(**setup_params)File "/data/user1/temp/setuptools-46.1.3/setuptools/__init__.py", line 144, in setupreturn distutils.core.setup(**attrs)File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setupdist.run_commands()File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commandsself.run_command(cmd)File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/data/user1/temp/setuptools-46.1.3/setuptools/command/install.py", line 67, in runself.do_egg_install()File "/data/user1/temp/setuptools-46.1.3/setuptools/command/install.py", line 109, in do_egg_installself.run_command('bdist_egg')File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/data/user1/temp/setuptools-46.1.3/setuptools/command/bdist_egg.py", line 235, in rundry_run=self.dry_run, mode=self.gen_header())File "/data/user1/temp/setuptools-46.1.3/setuptools/command/bdist_egg.py", line 502, in make_zipfilez = zipfile.ZipFile(zip_filename, mode, compression=compression)File "/usr/local/lib/python3.6/zipfile.py", line 1066, in __init___check_compression(compression)File "/usr/local/lib/python3.6/zipfile.py", line 649, in _check_compression"Compression requires the (missing) zlib module")
RuntimeError: Compression requires the (missing) zlib module
解决:重新将python编译安装一下。会自动装上pip和setuptools。zlib和ssl也可以通过加入编译连接给装上。