小编Bil*_*uel的帖子

错误:安装脚本退出并显示错误:命令'gcc'失败,退出状态为1

当我尝试在Fedora 14中的Python 2.6下安装MySQL-python-1.2.3时,我收到以下错误.

默认情况下Fedora 14附带Python 2.7,我正在使用Python 2.6运行的项目,所以我无法将Python从2.6升级到2.7.

_mysql.c:35:23: fatal error: my_config.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

完整的错误消息如下

[root@localhost MySQL-python-1.2.2]# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
copying _mysql_exceptions.py -> build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.6/MySQLdb
creating build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.6/MySQLdb/constants …
Run Code Online (Sandbox Code Playgroud)

python mysql mysql-python

19
推荐指数
3
解决办法
3万
查看次数

mod_wsgi拒绝在项目文件夹中写入日志文件的权限

我在使用mod_wsgi部署应用程序时收到以下错误

[Thu Apr 07 11:23:32 2011] [error] [client localhost] IOError: [Errno 13] Permission denied: '/var/www/vhosts/myproject/myproject.log'
Run Code Online (Sandbox Code Playgroud)

apache deployment django apache2

4
推荐指数
1
解决办法
3989
查看次数

如何在IOS sdk(Objective-c)中序列化一个类?

如何在objective-c中序列化以下类,以便它可以与SBJson一起使用?

当我使用此代码时,我得到"动物不支持JSON序列化"错误.

有人能指出我哪里错了吗?

Animal.h文件的内容如下

#import <UIKit/UIKit.h>

@interface Animal : NSObject<NSCoding> {
    NSString *name;
    NSString *description;
    NSString *imageURL;
}

@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *description;
@property (nonatomic, retain) NSString *imageURL;

-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u;

@end
Run Code Online (Sandbox Code Playgroud)

Animal.m文件的内容如下

#import "Animal.h"

@implementation Animal
@synthesize name, description, imageURL;

-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u {
    self.name = n;
    self.description = d;
    self.imageURL = u;
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    if(self = [super initWithCoder:aDecoder])
    {
        name = [[aDecoder …
Run Code Online (Sandbox Code Playgroud)

iphone serialization json objective-c sbjson

4
推荐指数
1
解决办法
2万
查看次数

Ruby等效于python数组

我需要一个ruby等效的以下python代码

import array
my_array = array.array('B', [0x00, 0x04, 0xcc, 0x50]).tostring()
Run Code Online (Sandbox Code Playgroud)

更新:我正在尝试使用ruby-serialport gem将4个字节写入串行端口.

通过将上面的字节数组写入串口,我能够使它在python中工作.现在我想在红宝石中做同样的事情.

ruby python ruby-on-rails bytearray

0
推荐指数
1
解决办法
327
查看次数