我一直在尝试在运行 Ubuntu 14.04.1 LTS 的虚拟机上安装 Monary,但没有成功。 我已经安装了 Mongo C 驱动程序,我认为这已经正确完成。
对全文表示歉意。
[更新:启用 ssl 和 sasl 使用:
sudo apt-get install -y libsasl2-dev libssl-dev
然后
./configure --enable-ssl --enable-sas
]
使用
sudo pip install monary #or even without sudo
[现在] 给出:
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)
我已经尝试重新安装/更新一些看似相关的软件包,但没有任何效果,而且我无法确定问题所在。
感谢任何帮助。谢谢!
最佳答案
我今天遇到了同样的问题。我通过引用此页面成功安装了 monary -0.5.0:
http://mongoc.org/libmongoc/current/installing.html (我的操作系统是 Ubuntu 16.04)
$ 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
关于python - 在 Ubuntu 上安装 Monary 0.4 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32468086/