boop
boop

Reputation: 61

Error pip installing monary

I'm trying to install the monary python package using pip. when I run the command

pip install monary

This is the full output

C:\Users\krist>pip install monary
Collecting monary
  Using cached Monary-0.5.0.tar.gz
Requirement already satisfied: pymongo in c:\users\krist\anaconda3\lib\site-packages (from monary)
Requirement already satisfied: numpy in c:\users\krist\anaconda3\lib\site-packages (from monary)
Building wheels for collected packages: monary
  Running setup.py bdist_wheel for monary ... error
  Complete output from command c:\users\krist\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krist\\AppData\\Local\\Temp\\pip-build-xkxevy62\\monary\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d 
C:\Users\krist\AppData\Local\Temp\tmp2hws0x_vpip-wheel- --python-tag cp35:
  C:\Users\krist\AppData\Local\Temp\pip-build-xkxevy62\monary\setup.py:90: 
UserWarning: WARNING: the python package pkgconfig is not installed. If you 
have pkg-config installed on your system, please install the python's pkgconfig, e.g. "pip install pkgconfig". Will use libmongoc=C:/Program Files\libmongoc and libbson=C:/Program Files\libbson instead.
% (mongoc_src, bson_src)))
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.5
  creating build\lib.win-amd64-3.5\monary
  copying monary\datehelper.py -> build\lib.win-amd64-3.5\monary
  copying monary\monary.py -> build\lib.win-amd64-3.5\monary
  copying monary\monary_param.py -> build\lib.win-amd64-3.5\monary
  copying monary\ordereddict.py -> build\lib.win-amd64-3.5\monary
  copying monary\write_concern.py -> build\lib.win-amd64-3.5\monary
  copying monary\__init__.py -> build\lib.win-amd64-3.5\monary
  running build_ext
  building 'monary.libcmonary' extension
  creating build\temp.win-amd64-3.5
  creating build\temp.win-amd64-3.5\Release
  creating build\temp.win-amd64-3.5\Release\monary
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:/Program Files\libmongoc\include\libmongoc-1.0" "-IC:/Program Files\libbson\include\libbson-1.0" -Ic:\users\krist\anaconda3\include -Ic:\users\krist\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt" /Tcmonary\cmonary.c /Fobuild\temp.win-amd64-3.5\Release\monary\cmonary.obj -fPIC -O2 -DNDEBUG
  cl : Command line warning D9002 : ignoring unknown option '-fPIC'
  cmonary.c
  monary\cmonary.c(8): fatal error C1083: Cannot open include file: 'mongoc.h': 
No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for monary
  Running setup.py clean for monary
Failed to build monary
Installing collected packages: monary
  Running setup.py install for monary ... error
    Complete output from command c:\users\krist\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krist\\AppData\\Local\\Temp\\pip-build-xkxevy62\\monary\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\krist\AppData\Local\Temp\pip-9enpcfz5-record\install-record.txt --single-version-externally-managed --compile:
C:\Users\krist\AppData\Local\Temp\pip-build-xkxevy62\monary\setup.py:90: UserWarning: WARNING: the python package pkgconfig is not installed. If you have pkg-config installed on your system, please install the python's pkgconfig, e.g. "pip install pkgconfig". Will use libmongoc=C:/Program Files\libmongoc and libbson=C:/Program Files\libbson instead.
  % (mongoc_src, bson_src)))
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\monary
copying monary\datehelper.py -> build\lib.win-amd64-3.5\monary
copying monary\monary.py -> build\lib.win-amd64-3.5\monary
copying monary\monary_param.py -> build\lib.win-amd64-3.5\monary
copying monary\ordereddict.py -> build\lib.win-amd64-3.5\monary
copying monary\write_concern.py -> build\lib.win-amd64-3.5\monary
copying monary\__init__.py -> build\lib.win-amd64-3.5\monary
running build_ext
building 'monary.libcmonary' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\monary
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:/Program Files\libmongoc\include\libmongoc-1.0" "-IC:/Program Files\libbson\include\libbson-1.0" -Ic:\users\krist\anaconda3\include -Ic:\users\krist\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt" /Tcmonary\cmonary.c /Fobuild\temp.win-amd64-3.5\Release\monary\cmonary.obj -fPIC -O2 -DNDEBUG
cl : Command line warning D9002 : ignoring unknown option '-fPIC'
cmonary.c
monary\cmonary.c(8): fatal error C1083: Cannot open include file: 'mongoc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

----------------------------------------
Command "c:\users\krist\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krist\\AppData\\Local\\Temp\\pip-build-xkxevy62\\monary\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\krist\AppData\Local\Temp\pip-9enpcfz5-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\krist\AppData\Local\Temp\pip-build-xkxevy62\monary\

I've tried uninstalling and reinstalling MS Visual Studio but I don't know what failed with exit status 2 means exactly, and I'm not sure how to fix the error in line:

monary\cmonary.c(8): fatal error C1083: Cannot open include file: 'mongoc.h': No such file or directory

What do I need to do to get this package downloaded?

Update: I noticed the warning to install pkgconfig and did that, but the end result is unchanged - still getting the same to errors at the end:

monary\cmonary.c(8): fatal error C1083: Cannot open include file: 'mongoc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

----------------------------------------
Command "c:\users\krist\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\krist\\AppData\\Local\\Temp\\pip-build-xkxevy62\\monary\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\krist\AppData\Local\Temp\pip-9enpcfz5-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\krist\AppData\Local\Temp\pip-build-xkxevy62\monary\

Upvotes: 0

Views: 885

Answers (1)

zhiqiang huang
zhiqiang huang

Reputation: 361

https://monary.readthedocs.io/installation.html You can use pip to install monary in platforms other than Windows:

$ pip install monary

Monary uses pkgconfig to find the libmongoc and libbson installations. If pkgconfig cannot find the libraries, it will look in the default locations: C:\Program Files\libmongoc and C:\Program Files\libbson for Windows, and /usr/local for other systems. If you cannot use pkgconfig and libmongoc and libbson are not installed in the default directories, you will need to pass the locations to the installation script:

$ python setup.py install --default-libmongoc C:\usr --default-libbson C:\usr If you are installing via pip, and libcmongo and libbson are not installed in the default directories, you must pass --default-libmongoc and --default-libbson to pip using --install-option.

Upvotes: 2

Related Questions