小编Dja*_*cks的帖子

在本地计算机上工作的命令,但在服务器中不起作用?

我正在使用ubuntu 10.04作为我的桌面和Ubunt 10.04服务器版本的服务器.

以下内容:

sudo pip install -e git+http://github.com/facebook/python-sdk.git#egg=facebook
Run Code Online (Sandbox Code Playgroud)

在我的桌面上工作,但在服务器上不起作用.

在服务器上,我收到以下错误消息:

Obtaining facebook from git+http://github.com/facebook/python-sdk.git#egg=facebook
  Cloning http://github.com/facebook/python-sdk.git to ./src/facebook
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/pip/basecommand.py", line 115, in main
    self.run(options, args)
  File "/usr/local/lib/python2.6/dist-packages/pip/commands/install.py", line 155, in run
    requirement_set.install_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/local/lib/python2.6/dist-packages/pip/req.py", line 805, in install_files
    req_to_install.update_editable(not self.is_download)
  File "/usr/local/lib/python2.6/dist-packages/pip/req.py", line 356, in update_editable
    vcs_backend.obtain(self.source_dir)
  File "/usr/local/lib/python2.6/dist-packages/pip/vcs/git.py", line 104, in obtain
    [self.cmd, 'clone', '-q', url, dest])
  File "/usr/local/lib/python2.6/dist-packages/pip/vcs/__init__.py", line 100, in cmd
    raise BadCommand('Cannot find command %s' % …
Run Code Online (Sandbox Code Playgroud)

terminal ubuntu ubuntu-10.04

3
推荐指数
1
解决办法
2656
查看次数

Django,Twitter Streaming API(使用Twython或其他库)相关

我可以知道是否有人在Twitter的Streaming API上使用Django有一个工作示例?如果示例使用Twython库会很棒.

或者,我是否可以知道从Twitter的流媒体API中捕获实时流数据是否存在通用方法?我在理解如何使用实时流数据方面遇到了一些问题.

最好的祝福.

django twitter

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

在Python中比较字符串:字符串X是ASCII,字符串Y是UTF

我有一个相当奇怪的问题:我如何比较字符串(使用Python),其中字符串X是ASCII,字符串Y是UTF还是Unicode?

目前,当我比较字符串时,我收到以下问题:

UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  filteredtext = [t for t in s if t.lower() not in stopwords]
Run Code Online (Sandbox Code Playgroud)

如何确保字符串格式相同?

最好的祝福.

python unicode ascii utf-8 string-comparison

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

Mac OS X 10.7.5上的致命错误'stdio.h'Python 2.7.3

我被告知这个问题更适合Stack Overflow(而不是ServerFault)

所以这里:

我的Mac OS X 10.7.5上有这个奇怪的问题

/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
Run Code Online (Sandbox Code Playgroud)

是什么导致了上述错误?这个错误一直困扰着我,我无法安装mysql-python,因为我坚持这一步.

我正在使用Python 2.7.3.像Google App Engine(python),python脚本,龙卷风这样的东西通常可以在我的mac上运行.但不是mysql-python.

我使用dmg映像安装MySQL并将mysql文件夹复制到/ usr/local /

我该如何解决?

我也试过运行命令:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ 而不是通过运行安装mysql-python sudo python setup.py install.

但收到以下内容:

running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg …
Run Code Online (Sandbox Code Playgroud)

python mysql macos python-2.7

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

not_analyzed为ElasticSearch上的嵌套类型?

我有一个关于在嵌套对象上执行构面搜索的问题.

举个例子,我有以下文件:

tags: [
   {
       tag: "tag0",
       tag_url: "http://xxxxxxx.com/tag/tag0/"
   },
   {
       tag: "tag1",
       tag_url: "http://xxxxxx.com/tag/tag1/"
   }
],

categories: [
    {
        category: "cat0",
        category_url: "http://xxxxxx.com/category/cat0/"
    },
    {
        category: "cat1",
        category_url: "http://xxxxxx.com/category/cat1/"
    }
],
Run Code Online (Sandbox Code Playgroud)

而且我想在tags.tag和上执行一个方面tags.tag_url

所以我使用什么映射来创建index:not_analyzed嵌套字段?

我试过这个映射:

    mapping_data[mapping_name]["properties"] = {
        "tags.tag" : {
            "type": "multi_field",
                "fields" : {
                    "tags.tag": {"type" : "string", "index" : "analyzed", "store": "yes"},
                    "untouched" : {"type" : "string", "index" : "not_analyzed"}
                }
        },
        "tags.tag_url" : {
            "type": "multi_field",
                "fields" : {
                    "tags.tag_url": {"type" …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

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

将CouchDB数据从远程服务器复制到本地计算机

我最近开始玩CouchDB,只是涉及一些小问题.

我正在尝试使用以下命令将数据从aremote服务器复制到我的远程计算机:

curl -X POST -d '{"source":"http://xxx.xxx.xx.xxx:5984/testing_replicate","target":"http://localhost:5984:testing_replicate"}' http://localhost:5984/_replicate
Run Code Online (Sandbox Code Playgroud)

不知怎的,这个命令没有响应.

做 和curl -X GET http://localhost:5984/

curl -X GET http://xxx.xxx.xx.xxx:5984/
Run Code Online (Sandbox Code Playgroud)

返回预期的响应: {"couchdb":"Welcome","version":"0.10.0"}

任何人都可以开导我吗?

最好的祝福.

couchdb database-replication

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