以下是说明:Download & Install PHOEBE 2.1.6
首次尝试:
const webViewScript = `
setTimeout(function() {
window.postMessage(document.documentElement.scrollHeight);
}, 500);
true; // note: this is required, or you'll sometimes get silent failures
`;
...
constructor(props) {
super(props);
this.state = {
webheight:100,
}
...
<WebView style={{height: this.state.webheight}}
automaticallyAdjustContentInsets={false}
scrollEnabled={false}
source={{uri: "http://<your url>"}}
onMessage={event => {
this.setState({webheight: parseInt(event.nativeEvent.data)});
}}
javaScriptEnabled={true}
injectedJavaScript ={webViewScript}
domStorageEnabled={true}
></WebView>
来自https://github.com/phoebe-project/phoebe2
的第二次尝试我有问题
pip install numpy phoebe
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.11.0) Collecting phoebe Using cached https://files.pythonhosted.org/packages/86/18/65d72fe5cf21c9e678d81408566a535026c782327869b7dcbffecd347de5/phoebe-2.1.6.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-ty7hrmts/phoebe/setup.py", line 6 print "Numpy is needed for running and building of PHOEBE" ^ SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ty7hrmts/phoebe/ You are using pip version 19.0.3, however version 19.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
我尝试安装它
python setup.py build
python setup.py build /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building extension "libphoebe" sources building extension "phoebe.algorithms.ceclipse" sources build_src: building npy-pkg config files running build_py running build_ext customize UnixCCompiler customize UnixCCompiler using build_check customize UnixCCompiler customize UnixCCompiler using build_check OS: Linux OS version: 4.10.0-38-generic sh: 1: c++: not found Compiler: c++ Compiler version: C compiler: i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC
compile options: '-I/usr/include/python2.7 -c' i686-linux-gnu-gcc: /tmp/6KUBK1XJLW_compiler_check.c i686-linux-gnu-gcc -pthread /tmp/6KUBK1XJLW_compiler_check.o -o /tmp/6KUBK1XJLW_compiler_check.exe Ready to compile with gcc 5.4.0 . OS: Linux OS version: 4.10.0-38-generic Compiler: i686-linux-gnu-gcc Compiler version: i686-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Ready to compile with gcc 5.4.0. extra_args=['-std=c++11'] extra_args=[] building 'libphoebe' extension compiling C++ sources C compiler: c++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC
compile options: '-I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c' extra options: '-std=c++11' c++: ./phoebe/lib/libphoebe.cpp sh: 1: c++: not found sh: 1: c++: not found error: Command "c++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c ./phoebe/lib/libphoebe.cpp -o build/temp.linux-i686-2.7/phoebe/lib/libphoebe.o -std=c++11" failed with exit status 127
c++: not found
但未成功
第三次尝试,我尝试过:
sudo apt install c++
然后我又收到有关c ++的错误
请问我做错了什么?谢谢
错误:
pip2 install --user phoebe
答案 0 :(得分:0)
首先,尝试安装构建工具How to install G++ the C++ compiler on Ubuntu
sudo apt install g++
sudo apt install build-essential
然后重试。