环境:
Ubuntu14.04 kernel:3.13.0-32-generic
Python:2.7.6 pip:1.5.4
$pip install pyinstaller
Requirement already satisfied (use --upgrade to upgrade): pyinstaller in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from pyinstaller)
Requirement already satisfied (use --upgrade to upgrade): pefile>=2017.8.1 in /usr/local/lib/python2.7/dist-packages (from pyinstaller)
Requirement already satisfied (use --upgrade to upgrade): macholib>=1.8 in /usr/local/lib/python2.7/dist-packages (from pyinstaller)
Requirement already satisfied (use --upgrade to upgrade): altgraph in /usr/local/lib/python2.7/dist-packages (from pyinstaller)
Requirement already satisfied (use --upgrade to upgrade): dis3 in /usr/local/lib/python2.7/dist-packages (from pyinstaller)
Requirement already satisfied (use --upgrade to upgrade): future in /usr/local/lib/python2.7/dist-packages (from pefile>=2017.8.1->pyinstaller)
Cleaning up...
按照上诉提示,执行下面命令
$pip install pyinstaller --upgrade
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1432, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 599, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1845, in remove
renames(path, new_path)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 296, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/bin/pyi-archive_viewer'
Storing debug log for failure in /home/admin/.pip/pip.log
还是报错,根据最后一句,缺少权限,所以
$sudo pip install pyinstaller --upgrade
Uninstalling altgraph:
Successfully uninstalled altgraph
Successfully installed pyinstaller setuptools altgraph
Cleaning up...
安装成功了,查看一下版本
$pyinstaller --version
/usr/local/lib/python2.7/dist-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
3.6
安装成功。