我一直无法使用Pyenv在macOS(10.13.6)上安装Python,并已就常见的构建问题用尽了所有建议。
pyenv-doctor报告:未安装OpenSSL开发标头。如各种相关GitHub问题中所述,重新安装OpenSSL无效,没有各种标志设置,例如(以各种组合):
export CFLAGS="-I$(brew --prefix openssl)/include"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig/"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)
(在命令行中也尝试了这些。)
(通过Homebrew尝试了OpenSSL 1.02p和1.1)
试过了
brew install readline xz
Run Code Online (Sandbox Code Playgroud)
和
$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.6.6
Run Code Online (Sandbox Code Playgroud)
和
$ CFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install 3.6.6
Run Code Online (Sandbox Code Playgroud)
和
xcode-select --install
(or via downloadable command line tools installer for reinstallation)
Run Code Online (Sandbox Code Playgroud)
没运气。
brew link --force openssl
Run Code Online (Sandbox Code Playgroud)
不允许(错误消息说使用标志)。
还尝试了:
$(brew --prefix)/opt/openssl/bin/openssl
Run Code Online (Sandbox Code Playgroud)
并在此处尝试了OpenSSL / macOS建议:
https://solitum.net/openssl-os-x-el-capitan-and-brew/
Run Code Online (Sandbox Code Playgroud)
$ PATH显示:
/usr/local/opt/openssl/bin:/Users/tc/google-cloud-sdk/bin:/Users/tc/Code/git/flutter/bin:/usr/local/sbin:/usr/local/heroku/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/tc/google-cloud-sdk/bin:/Users/tc/Code/git/flutter/bin:/usr/local/sbin:/usr/local/heroku/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/tc/google-cloud-sdk/bin:/Users/tc/.nvm/versions/node/v8.11.3/bin:/Users/tomclaburn/Code/git/flutter/bin:/usr/local/sbin:/usr/local/heroku/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local/mongodb/bin:/usr/local/opt/openssl/bin/openssl:/usr/local/mongodb/bin:/usr/local/mongodb/bin
Run Code Online (Sandbox Code Playgroud)
.bash_profile包含:
if [ -d …Run Code Online (Sandbox Code Playgroud) 我无法理解如何将单个Promise调整为一系列Promise,一旦两个API调用都返回,它就会解析.
如何将下面的代码重写为Promises链?
function parseTweet(tweet) {
indico.sentimentHQ(tweet)
.then(function(res) {
tweetObj.sentiment = res;
}).catch(function(err) {
console.warn(err);
});
indico.organizations(tweet)
.then(function(res) {
tweetObj.organization = res[0].text;
tweetObj.confidence = res[0].confidence;
}).catch(function(err) {
console.warn(err);
});
}Run Code Online (Sandbox Code Playgroud)
谢谢.