python-3.x - macOS Python3.7.4 不会导入 wx 并且 pip 不会安装它
问题描述
尝试wxPython
在MacBook Air 上运行,但有macOS 10.14.6.
几个问题。
当我跑进去3.7.1 (installed while using Anaconda)
运行 awx script
时,我得到了这个错误:
该程序需要访问屏幕。请使用 Python 的框架构建运行,并且仅当您在 Mac 的主显示屏上登录时运行。
我安装了3.7.4 framework
,但是当我尝试运行import
或pip
收到以下报告时:
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
. 我被卡住了。。
解决方案
推荐阅读
- javascript - 剪贴板链接作为代码/文本而不是链接粘贴到所见即所得
- android - 插入 MySQL 数据库不起作用
- vb.net - Oracle 存储过程被执行。DataSet 从 vb.net 不返回任何内容
- javascript - 将 Float32Array 复制到 Safari 和 Edge 中的新 AudioBuffer
- python - 抓取非格式化的json
- scala - 如何将列表值转换为Key、值格式?
- linq - 如何在 LINQ 中从具有多个 ID 的记录中查询名称
- java - 从 onpostexecute 发送值
- python - 需要更新每一行的数组或数据帧上的 Python 操作
- drupal - 无法检查树枝中的标题值,Drupal 8