首页 > 解决方案 > macOS Python3.7.4 不会导入 wx 并且 pip 不会安装它

问题描述

尝试wxPythonMacBook Air 上运行,但有macOS 10.14.6. 几个问题。

当我跑进去3.7.1 (installed while using Anaconda)运行 awx script时,我得到了这个错误:

该程序需要访问屏幕。请使用 Python 的框架构建运行,并且仅当您在 Mac 的主显示屏上登录时运行。

我安装了3.7.4 framework,但是当我尝试运行importpip收到以下报告时:

Grahams-MacBook-Air:~ grahamhansen$ python3.7
Python 3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'wx'
>>> brew install wxpython
  File "<stdin>", line 1
    brew install wxpython
               ^
SyntaxError: invalid syntax

我安装了3.7.4 at the OS level. 我被卡住了。。

标签: python-3.xmacoswxpython

解决方案


推荐阅读