我正在使用High Sierra,并且无法通过brew install安装图形工具。下面给出的是brew安装后的输出。
Private Declare Function SetTimer Lib "user32" _
(ByVal HWnd As Long, ByVal nIDEvent As Long,
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Function Method1(varValsIn As Variant) As Variant
Dim lngWindowsTimerID As Long
'doing some stuff
'call API function after doing some stuff
lngWindowsTimerID = SetTimer(0&, 0&, 1, AddressOf DoStuff)
End Sub
Private Sub DoStuff
'Stuff to do
End Sub
由于我使用的是被锁定的机器,因此无法更新到Mojave。我以前可以{@ {1}}在High Sierra上毫无问题。
homebrew formulae link for graph-tool似乎声明它仅适用于Mojave。公式本身也一样。
https://github.com/Homebrew/homebrew-core/blob/master/Formula/graph-tool.rb
> brew install graph-tool
graph-tool: macOS Mojave or newer is required.
Error: An unsatisfied requirement failed this build.
有什么方法可以在计算机上安装旧版的graph-tool?
更新
这可能不适用于大多数人。但是由于安装了graph_tool太费劲了,所以我想在这里复制我的解决方案。
在尝试bfontaine的解决方案时,我不断收到以下错误:
brew install graph-tool
我意识到我不会使用图表工具的(出色)功能进行可视化,所以我下载了bfontaine链接到下面的graph_tool.rb文件,从中删除了matplotlib依赖项,然后运行depends_on :macos => :mojave # for C++17
。
然后我将numpy降级为1.16.1,并且graph_tool可以按预期工作!
同样,仅在您不打算使用graph_tool的可视化功能时执行此操作。
有关修改后的graph_tool.rb文件,请参见下文。
==> /usr/local/Cellar/graph-tool/2.27_7/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/graph-tool--matplotlib-20190621-40984-1767uhv/matplotlib-2.2.2
Last 15 lines from /Users/greatora/Library/Logs/Homebrew/graph-tool/05.pip:
Removed build tracker '/private/tmp/pip-req-tracker-b74drkg2'
ERROR: Command "/usr/local/Cellar/graph-tool/2.27_7/libexec/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/tmp/pip-req-build-6ib3tzd9/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-8ubg3x4_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/graph-tool/2.27_7/libexec/bin/../include/site/python3.7/matplotlib" failed with error code 1 in /private/tmp/pip-req-build-6ib3tzd9/
Exception information:
Traceback (most recent call last):
File "/usr/local/Cellar/graph-tool/2.27_7/libexec/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
status = self.run(options, args)
File "/usr/local/Cellar/graph-tool/2.27_7/libexec/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 414, in run
use_user_site=options.use_user_site,
File "/usr/local/Cellar/graph-tool/2.27_7/libexec/lib/python3.7/site-packages/pip/_internal/req/__init__.py", line 58, in install_given_reqs
**kwargs
File "/usr/local/Cellar/graph-tool/2.27_7/libexec/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 951, in install
spinner=spinner,
File "/usr/local/Cellar/graph-tool/2.27_7/libexec/lib/python3.7/site-packages/pip/_internal/utils/misc.py", line 776, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip._internal.exceptions.InstallationError: Command "/usr/local/Cellar/graph-tool/2.27_7/libexec/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/tmp/pip-req-build-6ib3tzd9/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-8ubg3x4_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/graph-tool/2.27_7/libexec/bin/../include/site/python3.7/matplotlib" failed with error code 1 in /private/tmp/pip-req-build-6ib3tzd9/
答案 0 :(得分:3)
图形工具2.28 requires macOS Mojave。该更新已于6月9日在Homebrew中进行了更新。您可以尝试在颠簸之前的提交时使用指向公式的直接URL来安装以前的版本:
brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/26177e166b/Formula/graph-tool.rb