/usr/bin/python3来自 macOS 10.15 上的 Xcode/CLT(目前为 DB6/PB5,使用 Xcode 11 beta 6)SSL: CERTIFICATE_VERIFY_FAILED对于源自 PSL 的所有 HTTPS 请求失败,例如来自urllib.request:
$ /usr/bin/python3 -c 'import urllib.request; urllib.request.urlopen("https://www.apple.com/")'
...
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)>
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题呢?
(我知道答案,很快就会发布;只是分享它以防其他人遇到它。)
我刚刚将我的MacBook Pro更新到macOS Catalina 10.15,并尝试编译和运行C++ 命令行程序,但我遇到了以前版本不存在的问题;
这是简单的代码:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!\n";
return 0;
}
Run Code Online (Sandbox Code Playgroud)
代码编译并输出预期,但 Xcode 仍然说:
fatal error: 'iostream' file not found
Run Code Online (Sandbox Code Playgroud)
我尝试将Build Settings/C++ Standard Library更改为libstdc++,但警告说:
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead
Run Code Online (Sandbox Code Playgroud)
并且仍然存在相同的 iostream 错误。
我尝试通过安装 PYENV 和 PYPIP 在我的 macOS Catalina 10.15.1 上升级我的 Python 版本,并将全局和本地设置为版本 3.8.0。但是当我尝试使用 python 版本时,它仍然显示内置在 MacOS 操作系统中的 python 版本。缺少哪一部分?
$ pyenv -v
pyenv 1.2.14
$ pypip -v
zsh: command not found: pypip
$ pyenv versions
system
* 3.8.0 (set by /Users/aj/.python-version)
$ pyenv global
3.8.0
$ pyenv local
3.8.0
$ python -V
Python 2.7.16
Run Code Online (Sandbox Code Playgroud) 我刚刚在 Macbook 上从 Mojave 升级到 macOS Catalina,并尝试从终端运行 python3 脚本,如下所示:python3 scriptname.py 我在终端中没有得到响应,然后出现错误:Python 意外退出并显示以下报告:请帮忙我解决了这个问题,或者我如何降级到莫哈韦沙漠,因为我需要它来工作
Process: Python [2726]
Path: /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 3.7.4 (3.7.4)
Code Type: X86-64 (Native)
Parent Process: Python [2723]
Responsible: Terminal [1574]
User ID: 501
Date/Time: 2020-01-23 23:24:33.722 +0000
OS Version: Mac OS X 10.15.2 (19C57)
Report Version: 12
Anonymous UUID: xxxx
Time Awake Since Boot: 1700 seconds
System Integrity Protection: enabled
Crashed Thread: 1 Dispatch queue: com.apple.root.default-qos
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000110
Exception Note: …Run Code Online (Sandbox Code Playgroud) 我的一台主机在 Mac OS Catalina 上运行,它经常用完磁盘空间...
我在那里运行计划任务,每天它都会将文件上传到/Users/labuser/myfolder并从该文件夹中删除旧文件。
在挖掘文件夹后,我发现/System/Volumes/Data/Users/labuser/myfolder占用了主机上 90% 的已占用空间。
有没有办法在 Catalina 上禁用此功能并阻止它增长 /System/Volumes/Data/... ?
我正在尝试在我的 mac 机器(macOS Catalina)上安装 xcode 并运行
xcode-select --install
Run Code Online (Sandbox Code Playgroud)
但收到一条带有消息“由于网络问题无法下载软件”的警报
问题
升级到 MacOS 10.15 Catalina 后,PHP 在读取某些链接而不是其他链接时遇到问题,运行 PHP(作为 Apache 的用户“www”)。问题似乎是对操作系统隐私/安全配置的更改,我们知道已经更改,而不是目录执行权限/FollowSymLink 权限。
细节
$ ls -alt /Users/[MYUSER]/Sites/*info.php
lrwxr-xr-x 1 [MYUSER] staff 8 Oct 10 11:16 /Users/[MYUSER]/Sites/linfo.php -> info.php
-rwxr-xr-x 1 [MYUSER] staff 25 Oct 30 2014 /Users/[MYUSER]/Sites/info.php
Run Code Online (Sandbox Code Playgroud)
在上面两个页面 info.php 和 linfo.php 功能正确,我认为这表明 FollowSymLinks 正在工作。
$ ls -alt /Users/[MYUSER]/Sites/*index.php
lrwxr-xr-x 1 [MYUSER] staff 78 Dec 30 2014 /Users/[MYUSER]/Sites/index.php -> /Users/[MYUSER]/Documents/[ADIR]/Development/GitHub/cms/sitesIndex.php
$ ls -alt /Users/[MYUSER]/Sites/sitesIndex.php
-rwxr-xr-x 1 [MYUSER] staff 20847 Oct 8 13:11 sitesIndex.php
Run Code Online (Sandbox Code Playgroud)
在上述页面 index.php 中,链接失败,而链接文件sitesIndex.php 的副本则成功。
背景
虽然我不相信它是相关的(因为无法 followSymLinks 有不同的错误消息),但以下是 FollowSymLinks …
我有一个简单的 C++ 程序,可以导入cmath.
#include <cmath>
int main() {
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下命令编译它。
clang++ -o test main.cpp -std=c++14
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误
In file included from main.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error:
no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/usr/local/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included …Run Code Online (Sandbox Code Playgroud) “在‘/’中找不到‘com.apple.pkg.cltools_executables’的收据”
在 MacOS (Catalina) 的 VS Code bash 终端中为 angular 9 项目运行“npm install”时抛出上述错误
Package.json 依赖项:
"@angular/animations": "~9.1.1",
"@angular/common": "~9.1.1",
"@angular/compiler": "~9.1.1",
"@angular/core": "~9.1.1",
"@angular/platform-browser": "~9.1.1",
"@angular/platform-browser-dynamic": "~9.1.1",
"@angular/router": "~9.1.1",
"rxjs": "~6.5.4",
"tslib": "1.10.0",
"zone.js": "0.10.2"
Run Code Online (Sandbox Code Playgroud) 我使用新的闪亮的WidgetKit制作了一个小部件。它看起来不错并且按预期工作。然后,我将其所有逻辑放入单独的框架中,以在扩展和主应用程序之间共享常量值,并提供可单元测试的目标。引入框架后,SwiftUI 预览停止工作。我收到错误:Cannot preview in this file - Could not find host for previews。WidgetPreviewContext似乎不起作用。我想知道为什么。难道是因为我使用的是 macOS Catalina 10.15.6?