首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ubuntu上安装Monary 0.4时出错

问在Ubuntu上安装Monary 0.4时出错
EN

Stack Overflow用户
提问于 2015-09-09 06:11:31
回答 3查看 756关注 0票数 1

我一直在尝试在运行Ubuntu 14.04.1 LTS的虚拟机上安装Monary,但没有成功。我已经安装了Mongo C驱动程序,我认为这已经做得很好了。

对全文表示歉意。

[更新:使用以下命令启用ssl和sasl:

代码语言:javascript
复制
sudo apt-get install -y libsasl2-dev libssl-dev

然后

代码语言:javascript
复制
./configure --enable-ssl --enable-sas

]

使用

代码语言:javascript
复制
sudo pip install monary #or even without sudo

现在给出:

代码语言:javascript
复制
Downloading/unpacking monary
  Downloading Monary-0.4.0.post2.tar.gz
  Running setup.py (path:/tmp/pip_build_root/monary/setup.py) egg_info for package monary

    warning: no previously-included files matching '*.py' found under directory 'test'
    warning: no previously-included files matching '*.py' found under directory 'timing'
Installing collected packages: monary
  Running setup.py install for monary
    building 'monary.libcmonary' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0 -I/usr/include/python2.7 -c monary/cmonary.c -o build/temp.linux-x86_64-2.7/monary/cmonary.o -fPIC -O2 -DNDEBUG
    monary/cmonary.c: In function ‘monary_connect’:
    monary/cmonary.c:130:9: error: unknown type name ‘mongoc_ssl_opt_t’
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
             ^
    monary/cmonary.c:130:9: warning: initialization makes integer from pointer without a cast [enabled by default]
    monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]
    monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]
    monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]
    monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]
    monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]
    monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]
    monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]
    monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]
    monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]
    monary/cmonary.c:132:9: warning: excess elements in scalar initializer [enabled by default]
             };
             ^
    monary/cmonary.c:132:9: warning: (near initialization for ‘opts’) [enabled by default]
    monary/cmonary.c:133:9: warning: implicit declaration of function ‘mongoc_client_set_ssl_opts’ [-Wimplicit-function-declaration]
             mongoc_client_set_ssl_opts(client, &opts);
             ^
    monary/cmonary.c: In function ‘monary_load_query’:
    monary/cmonary.c:1018:9: warning: variable ‘total_values’ set but not used [-Wunused-but-set-variable]
         int total_values;
             ^
    monary/cmonary.c: In function ‘monary_insert’:
    monary/cmonary.c:1374:11: warning: unused variable ‘str’ [-Wunused-variable]
         char *str;
               ^
    monary/cmonary.c:1368:25: warning: unused variable ‘citem’ [-Wunused-variable]
         monary_column_item *citem;
                             ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/monary/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-2kCMXO-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/monary

copying monary/ordereddict.py -> build/lib.linux-x86_64-2.7/monary

copying monary/monary.py -> build/lib.linux-x86_64-2.7/monary

copying monary/monary_param.py -> build/lib.linux-x86_64-2.7/monary

copying monary/datehelper.py -> build/lib.linux-x86_64-2.7/monary

copying monary/__init__.py -> build/lib.linux-x86_64-2.7/monary

copying monary/write_concern.py -> build/lib.linux-x86_64-2.7/monary

running build_ext

building 'monary.libcmonary' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/monary

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0 -I/usr/include/python2.7 -c monary/cmonary.c -o build/temp.linux-x86_64-2.7/monary/cmonary.o -fPIC -O2 -DNDEBUG

monary/cmonary.c: In function ‘monary_connect’:

monary/cmonary.c:130:9: error: unknown type name ‘mongoc_ssl_opt_t’

         mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,

         ^

monary/cmonary.c:130:9: warning: initialization makes integer from pointer without a cast [enabled by default]

monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]

monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]

monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]

monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]

monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]

monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]

monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]

monary/cmonary.c:130:9: warning: excess elements in scalar initializer [enabled by default]

monary/cmonary.c:130:9: warning: (near initialization for ‘opts’) [enabled by default]

monary/cmonary.c:132:9: warning: excess elements in scalar initializer [enabled by default]

         };

         ^

monary/cmonary.c:132:9: warning: (near initialization for ‘opts’) [enabled by default]

monary/cmonary.c:133:9: warning: implicit declaration of function ‘mongoc_client_set_ssl_opts’ [-Wimplicit-function-declaration]

         mongoc_client_set_ssl_opts(client, &opts);

         ^

monary/cmonary.c: In function ‘monary_load_query’:

monary/cmonary.c:1018:9: warning: variable ‘total_values’ set but not used [-Wunused-but-set-variable]

     int total_values;

         ^

monary/cmonary.c: In function ‘monary_insert’:

monary/cmonary.c:1374:11: warning: unused variable ‘str’ [-Wunused-variable]

     char *str;

           ^

monary/cmonary.c:1368:25: warning: unused variable ‘citem’ [-Wunused-variable]

     monary_column_item *citem;

                         ^

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/monary/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-2kCMXO-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/monary
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 34: ordinal not in range(128)

我已经尝试重新安装/更新了一些相关的包,但都没有效果,也找不到问题所在。

感谢您的帮助。谢谢!

EN

回答 3

Stack Overflow用户

发布于 2018-01-18 15:29:45

今天我也遇到了同样的问题。参考此页面,我成功安装了page 0.5.0:

http://mongoc.org/libmongoc/current/installing.html (我的操作系统是Ubuntu16.04)

代码语言:javascript
复制
$ sudo apt-get install pkg-config libssl-dev libsasl2-dev
$ wget https://github.com/mongodb/mongo-c-driver/releases/download/1.9.2/mongo-c-driver-1.9.2.tar.gz
$ tar xzf mongo-c-driver-1.9.2.tar.gz
$ cd mongo-c-driver-1.9.2
$ ./configure --disable-automatic-init-and-cleanup
$ make
$ sudo make install
$ pip install pymongo monary  #install monary
票数 2
EN

Stack Overflow用户

发布于 2015-09-09 06:31:15

下面是安装Monary的详细步骤,从一个完全库存的Ubuntu 14.04虚拟机开始,这是我刚刚用Vagrant从头开始构建的:

代码语言:javascript
复制
$ sudo apt-get -qq install -y build-essential pkg-config libsasl2-dev libssl-dev python-dev python-numpy python-pip
$ curl -LOs https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
$ tar zxf mongo-c-driver-1.1.10.tar.gz
$ cd mongo-c-driver
$ ./configure --enable-ssl --enable-sasl
< ... output ... >
libmongoc was configured with the following options:

  SASL                                             : sasl2
  SSL                                              : yes
$ make -j8 && sudo make install
< ... output ... >
$
$ # Prove we built with SSL:
$
$ grep mongoc_ssl_opt_t /usr/local/include/libmongoc-1.0/mongoc-ssl.h
typedef struct _mongoc_ssl_opt_t mongoc_ssl_opt_t;
struct _mongoc_ssl_opt_t
const mongoc_ssl_opt_t *mongoc_ssl_opt_get_default (void) BSON_GNUC_CONST;
$
$ nm /usr/local/lib/libmongoc-1.0.so | grep set_ssl
000000000000bdb0 T mongoc_client_pool_set_ssl_opts
000000000000b1f0 T mongoc_client_set_ssl_opts
$
$ sudo pip install pkgconfig # optional
Successfully installed pkgconfig
$ sudo pip install pymongo monary 
< ... output ... >
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import monary
>>> monary.version
'0.4.0'
票数 1
EN

Stack Overflow用户

发布于 2018-03-02 15:22:55

在Ubuntu - In终端上安装Monary,输入以下命令:

使能安装libbson-1.0

  • sudo apt-get安装libmongoc-1.0-0

  • sudo apt-get install pkg-

  • libssl-dev libsasl2-dev

  • tar xzf mongo-c-driver-1.6.2.tar.gz

  • cd mongo-c-driver-1.6.2

  • ./configure --disable-automatic-init-and-cleanup

  • make

  • sudo
  1. sudoapt-get安装git gcc automake autoconf libtool
  2. sudo -H pip3 install
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32468086

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档