为什么pyinstaller无法加载/执行

时间:2019-01-16 11:28:45

标签: python ios pyinstaller

每当我使用pip install(在Mac上)安装pyinstaller后,尝试使用pyinstaller时,都会收到以下错误。有人可以帮我解决这个问题吗?使用哪个pyinstaller可以找到路径,但是尝试添加到$ PATH却找不到它:

Traceback (most recent call last):
  File "/usr/local/bin/pyinstaller", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3095, in <module>
    @_call_aside
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
    f(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 660, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 673, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 851, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (altgraph 0.10.2 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('altgraph>=0.15'), set(['macholib']))

这是添加到$ PATH的输出:

$PATH=$PATH:/usr/local/bin/pyinstaller
-bash: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/bin/pyinstaller: No such file or directory

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误...能够通过在用户的python路径下安装更新的altgraph软件包来解决此错误。希望这对找到此页面的其他人有所帮助。

pip install --user altgraph==0.15