我试图从终端运行python脚本,但收到下一条错误消息:
ImportError: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
如果我运行print sys.version,我得到:
>>> import sys
>>> print sys.version
2.7.3 (default, Feb 26 2013, 16:27:39)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]
Run Code Online (Sandbox Code Playgroud)
如果我运行ldd/usr/local/bin/python
>> ldd /usr/local/bin/python
linux-vdso.so.1 => (0x00007fff219ff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003300c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003300800000)
libutil.so.1 => /lib64/libutil.so.1 (0x0000003310e00000)
libm.so.6 => /lib64/libm.so.6 (0x0000003300000000)
libc.so.6 => /lib64/libc.so.6 (0x0000003300400000)
/lib64/ld-linux-x86-64.so.2 (0x00000032ffc00000)
Run Code Online (Sandbox Code Playgroud)
我不明白我有哪个python?为什么从终端运行这个python脚本失败?我试过跑
export LD_LIBRARY_PATH=/usr/local/lib/python2.7/
Run Code Online (Sandbox Code Playgroud)
没有运气......
BTW - 我已经设法使用python插件在eclipse中调试此脚本,当我查看调试配置时,我看到PYTHONPATH设置为:
/..../eclipse/plugins/org.python.pydev_3.1.0.201312121632/pysrc/pydev_sitecustomize:/..../workspace/style_checker/src:/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg:/usr/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg:/usr/local/lib/python2.7:/usr/local/lib/python2.7/plat-linux2:/usr/local/lib/python2.7/lib-tk:/usr/local/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/site-packages
Run Code Online (Sandbox Code Playgroud)
所以eclipse以某种方式管理这个python2.7库...所以我怎么能用eclipse和命令行来做呢?我究竟做错了什么 ?使用CentOS6.
我正在尝试使用gdbserver进行调试.在我终止主机上的gdb客户端后,我看到gdbserver仍在监听:
Remote side has terminated connection. GDBserver will reopen the connection.
Listening on port 5004
Run Code Online (Sandbox Code Playgroud)
我试图退出gdbserver,我发现任何地方都没有运气:退出,退出,q,监视器退出,Esc,Cnt + c ...没有什么可以杀死它.此外,当我打开另一个终端并查找运行gdbserver的进程(使用命令ps,top)时,我找不到它...我的问题是 - 如何终止gdbserver?
当我尝试通过我的vnc连接到我的服务器时,我偶尔会遇到"zlibinstream:exceeded bytesIn"错误.为什么我会收到此错误,如何解决此问题 - 无需重新启动服务器?
我正在尝试应用我通过eclipse执行的存储但我收到下一条错误消息:由于"应用存储的更改导致冲突",应用存储提交'...'失败.我怎样才能解决日食中的冲突?试图打开同步视图,但我没有看到任何需要解决的问题...使用eclipse kepler.
我想简单地拍一张照片并用我的三星galaxy s在ImageView中呈现它.当我在风景上而不是在肖像上做它时工作正常.我没有得到任何错误或异常 - 只是没有得到任何东西......有很多关于这个主题的问题,它似乎有问题(关于相机方向的东西),但不能找出一个简单的最终解决方案"拍照并呈现"代码.这是我的(有问题的)代码不起作用:
private void setUpListeners() {
takePicture.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
if (requestCode == CAMERA_PIC_REQUEST) {
Log.d("onActivityResult", "CAMERA_PIC_REQUEST returned");
dishImage = (Bitmap) data.getExtras().get("data");
if (dishImage==null)
Log.d("onActivityResult", "dishImage==null");
imageView = (ImageView) findViewById(R.id.dishinfodishimageview);
imageView.setImageBitmap(dishImage);
imageView.setVisibility(View.VISIBLE);
takePicture.setVisibility(View.GONE);
(new UploadImage()).execute(null);
}
} else {
Log.e("onActivityResult",
"no able to …Run Code Online (Sandbox Code Playgroud) 我尝试使用新编译器编译旧代码并得到下一个错误:
error: cannot take the address of an rvalue of type 'int'
Run Code Online (Sandbox Code Playgroud)
下面是两行示例 - 一行编译,另一行编译错误
struct mstct {
int myfield;
int myfield2[5];
int myfield3[5];
};
typedef struct mstct db_data_px;
int foo(int a, int b, int c){
//the next code compiles successfully.
unsigned val1 = ((18 == c) ? ((unsigned) & (((db_data_px *) 0)->myfield)) : ((unsigned) & (((db_data_px *) 0)->myfield3[b]))); //successes
//the next code is failing
unsigned val2 = (unsigned) & ((18 == c) ? (((db_data_px *) 0)->myfield) : (((db_data_px *) …Run Code Online (Sandbox Code Playgroud) 有没有人成功地用 Eclipse 运行和调试 Scheme?
我已经绑定了几个插件(方案 48,scheme),但无法让它们工作。我不确定为什么它们不起作用;我下载了一个解释器 ( kawa, mit-scheme) 并尝试在插件中配置它,但没有发生任何事情(除了mit-scheme抛出了一些错误)。
我知道还有另一种方法 - Racket,但我不想使用其他 IDE。我使用多种语言,我希望能够为所有语言使用一个 IDE。
有什么建议?
编辑:我试图运行最简单的 .scm 文件(其中只有 (+ 1 1) 个)。通过插件的配置我的意思是我选择一个外部解释器,然后选择kawa/mit-scheme解释器exe文件。当我选择带有 schemeway 的 kawa 时,它会打开一个新窗口并等待我的输入(我没有任何输入 - 只是想运行文件......)。当我用 mit-scheme 解释器做这件事时,我得到了这个错误......我使用的是 linux-centOS 6。
我希望靠近我的位置订购所有餐馆.我正在使用google places api使用textsearch:https://psps.googleapis.com/maps/api/place/textsearch/json?query = restaurant&location = 32.16107,34.806618&radius = 200&senns = true&key = api_key .我得到的结果是稀疏的,没有任何顺序.我尝试了rankby = distance但是对于文档(https://developers.google.com/places/documentation/)你只能在常规搜索中使用它,这意味着当使用textsearch时没有这样的参数选项(我试过了)无论如何 - >不工作).我正在使用textsearch,因为常规搜索只返回"类型":["establishment"].我如何通过远程订购google place api的文本搜索?我不敢相信谷歌没有创造出这样做的方法......
有没有办法运行 clang 并添加 llc 标志?我想使用“-print-after-all”、“-print-before-all”、“-debug-only”...而不必在其间使用 .bc 文件。
I am trying to add support to a new arch in llvm backend (llc). However I have found it diffcult to add a new SDNode that has 2 results. I saw in the sparc arch that UMUL/SMUL has 2 results (the second is Y) so they defined:
let Defs = [Y] in {
defm UMUL : ...
defm SMUL : ...
}
Run Code Online (Sandbox Code Playgroud)
and
let Uses = [Y], ... in
def RDY : ...
Run Code Online (Sandbox Code Playgroud)
and in the select function it looks …
我创建了一个从 TFS 获取源代码并构建项目的工作。一切正常,直到我在作业中标记了“在构建开始/结束之前/之后删除工作区”。现在我得到“已完成获取版本'...'。检索到 0 个资源”。每次构建开始时如何告诉 Jenkins 重新下载项目?
我派生了类和基类.在派生类的构造函数中,我必须使用基类的基本构造函数.然后我想用deiffernet基类构造函数重新构造基类:
class A
{
public:
int a, b;
}
class B : public A
{
B() : A()
{
...
//do some calculations to calculate a and b and then
//re-construct class A with the right values.
A(a,b) <--- ????
}
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做?
我有一个全局变量1,2,3 ......我有一个变量"num"(它是一个字符串)可以是"一个"或"两个"或"三个"......我想做下一个事情:
if num == "one":
one = True
elif num=="two":
two = True
elif num=="three":
three = True
...
Run Code Online (Sandbox Code Playgroud)
在Perl中,我可以用1行来完成:类似于eval"$ num = True"而不是上面的long if.我怎么能在python中做到这一点?