sysconfig cflags and ldflags does not link python into a C executable - python

So I am looking for a cross platform way to compile, and link Python into a C executable. I am following this page as a guide, such as with this example listed here. One problem is, the last section recommends using sysconfig or looking for the python*-config executable installed next to the interpreter to get the cflags and ldflags used to embed Python. However, those do not work
On my mac, the CFLAGS are "-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk" and the LDFLAGS are "-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk" . But using those with the documentation's example does not work, and always results in include errors. Even if i tweak it and add the -I option for where Python's include dir is, it gives linker errors:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 test.c -o test
Undefined symbols for architecture x86_64:
"_PyMem_RawFree", referenced from:
_main in test-75ae4e.o
"_PyRun_SimpleStringFlags", referenced from:
_main in test-75ae4e.o
"_Py_DecodeLocale", referenced from:
_main in test-75ae4e.o
"_Py_FinalizeEx", referenced from:
_main in test-75ae4e.o
"_Py_Initialize", referenced from:
_main in test-75ae4e.o
"_Py_SetProgramName", referenced from:
_main in test-75ae4e.o
ld: symbol(s) not found for architecture x86_64
My question here is, how does one reliably determine the flags to link / include python into a C executable ? and how can those be determined on msvc, gcc, or clang?

I discovered this is possible with the --embed option. Although this is not documented in the Python documentation, here's an example on MacOS
% /usr/local/opt/python#3.9/bin/python3-config --cflags --embed
-I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
% /usr/local/opt/python#3.9/bin/python3-config --ldflags --embed
-L/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin -lpython3.9 -ldl -framework CoreFoundation
And then putting it altogether to compile and link a C executable with Python
gcc -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -L/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin -lpython3.9 -ldl -framework CoreFoundation test.c -o test

Related

Installation fails when installing fastnumbers

I am trying to install a python library that depends on fastnumbers 3.0.0, but when trying to install it, I get the following:
warnings.warn(
running build
running build_ext
creating build
creating build/temp.macosx-11-x86_64-3.9
creating build/temp.macosx-11-x86_64-3.9/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -stdlib=libc++ -I/private/var/folders/_d/kht28yq15hjbm17zkr9_zhkh0000gp/T/pip-install-p7m6zg86/fastnumbers_538a0b1c68c844a0a91900d614d59f53/include -I/Users/carlos/ide-mx-decision-fraud/env/include -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/fastnumbers.c -o build/temp.macosx-11-x86_64-3.9/src/fastnumbers.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -stdlib=libc++ -I/private/var/folders/_d/kht28yq15hjbm17zkr9_zhkh0000gp/T/pip-install-p7m6zg86/fastnumbers_538a0b1c68c844a0a91900d614d59f53/include -I/Users/carlos/ide-mx-decision-fraud/env/include -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/numbers.c -o build/temp.macosx-11-x86_64-3.9/src/numbers.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -stdlib=libc++ -I/private/var/folders/_d/kht28yq15hjbm17zkr9_zhkh0000gp/T/pip-install-p7m6zg86/fastnumbers_538a0b1c68c844a0a91900d614d59f53/include -I/Users/carlos/ide-mx-decision-fraud/env/include -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/objects.c -o build/temp.macosx-11-x86_64-3.9/src/objects.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -stdlib=libc++ -I/private/var/folders/_d/kht28yq15hjbm17zkr9_zhkh0000gp/T/pip-install-p7m6zg86/fastnumbers_538a0b1c68c844a0a91900d614d59f53/include -I/Users/carlos/ide-mx-decision-fraud/env/include -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/parsing.c -o build/temp.macosx-11-x86_64-3.9/src/parsing.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -stdlib=libc++ -I/private/var/folders/_d/kht28yq15hjbm17zkr9_zhkh0000gp/T/pip-install-p7m6zg86/fastnumbers_538a0b1c68c844a0a91900d614d59f53/include -I/Users/carlos/ide-mx-decision-fraud/env/include -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/strings.c -o build/temp.macosx-11-x86_64-3.9/src/strings.o
src/strings.c:115:20: error: implicit declaration of function '_Py_dg_stdnan' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return PyFloat_from_NaN(sign < 0);
^
/private/var/folders/_d/kht28yq15hjbm17zkr9_zhkh0000gp/T/pip-install-p7m6zg86/fastnumbers_538a0b1c68c844a0a91900d614d59f53/include/fastnumbers/numbers.h:24:55: note: expanded from macro 'PyFloat_from_NaN'
#define PyFloat_from_NaN(negative) PyFloat_FromDouble(_Py_dg_stdnan(negative));
^
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
I am using a mac with big sur and python 3.9.
I already tried exporting the variables as is stated in this other question but it didn't solve my issue
This is compatibility problem with Python 3.9. It was reported and fixed in Nov 2020. Upgrade to fastnumbers 3.1.0 or 3.2.1.
If you cannot upgrade downgrade to Python 3.8.

Cmake cannot add "-fPIE" flag to makefile

I'm trying to compile C++ code with python embedded in it. The compiler does not compile my code with '-fPIE' flag even though I've added it in CMakeList.txt. Here's my CMakeList:
cmake_minimum_required(VERSION 3.3)
project(TestCython)
add_executable(main main.cpp)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.8-6QL2k7/python3.8-3.8.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -fPIE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.8-6QL2k7/python3.8-3.8.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -fPIE")
# Eigen
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
# Embedded Python Includes
include_directories(/usr/include/python3.8
/usr/include/eigen3/ )
# Embedded Python Linker
link_directories(/usr/lib/python3.8/config-3.8-x86_64-linux-gnu
/usr/lib)
target_link_libraries( main
python3.8
crypt
pthread
dl
util
m )
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
If I run the generated make file, it will report a lot of similar errors and ask me to recompile with '-fPIE', like this one:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libpython3.8.a(call.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
The compilation succeeds if I don't use cmake:
g++ -I/usr/include/python3.8 -Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.8-6QL2k7/python3.8-3.8.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -fPIE main.cpp -o main -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -L/usr/lib -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm
Cmake version is 3.16.3. Python version is 3.8.2. System is Ubuntu 20.04
How can I solve those errors?
Note that most of the time this error has nothing to do with the PIE flag but is rather something else screwy about your build, unfortunately it’s a bit hard to tell because your CMake config is a bit screwy.
This particular error however is probably because you’re setting your properties incorrectly; Setting CMAKE_CXX_FLAGS and similar variables does nothing if you do it after defining your target with add_executable. This can be avoided entirely by using a more modern CMake style (out of scope for this answer, just google Modern CMake for some examples), in this particular case instead of setting flags on those variables you could for example do
target_compile_options(main PRIVATE -fpie)
I had similar error when I linked my library env2048 (having a file called ppo_buffer) to my bindings module env2048bindings:
[build] FAILED: python/env2048bindings.cpython-37m-x86_64-linux-gnu.so
[build] : && /usr/bin/g++-7 -fPIC -g -shared -o python/env2048bindings.cpython-37m-x86_64-linux-gnu.so python/CMakeFiles/env2048bindings.dir/env2048/bindings.cpp.o src/libenv2048.a -pthread && :
[build] /usr/bin/ld: src/libenv2048.a(ppo_buffer.cpp.o): relocation R_X86_64_PC32 against symbol `_ZSt3minIlERKT_S2_S2_' can not be used when making a shared object; recompile with -fPIC
[build] /usr/bin/ld: final link failed: Bad value
I had to set the properties for the library to make it work with:
set_target_properties(env2048 PROPERTIES POSITION_INDEPENDENT_CODE ON)
From these, I would make the guess that you might need this:
set_target_properties(python3.8 PROPERTIES POSITION_INDEPENDENT_CODE ON)

pygame_sdl2 build error in python 3.6.4

I'm unable to build pygame_sdl2 on my Mac OS 10.12.6 Sierra Machine.I have done all the steps on https://github.com/renpy/pygame_sdl2/ on Python 3.6.4 until "build setup.py install"
This is the full log in terminal
AvendeMacBook-Pro:pygame_sdl2-master aven$ ./bin/python3 setup.py install
running install
running bdist_egg
running egg_info
writing pygame_sdl2.egg-info/PKG-INFO
writing dependency_links to pygame_sdl2.egg-info/dependency_links.txt
writing top-level names to pygame_sdl2.egg-info/top_level.txt
reading manifest file 'pygame_sdl2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pygame_sdl2.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.12-x86_64/egg
running install_lib
running build_py
running build_ext
building 'pygame_sdl2.mixer' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.mixer.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.mixer.o -D_THREAD_SAFE
gen3/pygame_sdl2.mixer.c:2392:46: error: use of undeclared identifier
'MIX_INIT_MODPLUG'; did you mean 'MIX_INIT_MOD'?
__pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MODPLUG); if (unli...
^~~~~~~~~~~~~~~~
MIX_INIT_MOD
/usr/local/include/SDL2/SDL_mixer.h:80:5: note: 'MIX_INIT_MOD' declared here
MIX_INIT_MOD = 0x00000002,
^
gen3/pygame_sdl2.mixer.c:2406:46: error: use of undeclared identifier
'MIX_INIT_FLUIDSYNTH'
__pyx_t_8 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLUIDSYNTH); if (u...
^
2 errors generated.
error: command 'clang' failed with exit status 1
AvendeMacBook-Pro:pygame_sdl2-master aven$ git clone https://github.com/renpy/pygame_sdl2
Cloning into 'pygame_sdl2'...
remote: Counting objects: 2022, done.
remote: Total 2022 (delta 1), reused 1 (delta 1), pack-reused 2020
Receiving objects: 100% (2022/2022), 1.24 MiB | 344.00 KiB/s, done.
Resolving deltas: 100% (1253/1253), done.
AvendeMacBook-Pro:pygame_sdl2-master aven$ ls
COPYING.LGPL21 gen run_pygame_test.py
COPYING.ZLIB gen3 scripts
MANIFEST.in include sdl2.c
README.rst lib setup.py
__pycache__ old-tests setuplib.py
bin pip-selfcheck.json setuplib.pyc
build pygame_sdl2 src
docs pygame_sdl2.egg-info test
fix_virtualenv.py run.sh
AvendeMacBook-Pro:pygame_sdl2-master aven$
AvendeMacBook-Pro:pygame_sdl2-master aven$ git clone https://github.com/renpy/pygame_sdl2
fatal: destination path 'pygame_sdl2' already exists and is not an empty directory.
AvendeMacBook-Pro:pygame_sdl2-master aven$ ls
COPYING.LGPL21 gen run_pygame_test.py
COPYING.ZLIB gen3 scripts
MANIFEST.in include sdl2.c
README.rst lib setup.py
__pycache__ old-tests setuplib.py
bin pip-selfcheck.json setuplib.pyc
build pygame_sdl2 src
docs pygame_sdl2.egg-info test
fix_virtualenv.py run.sh
AvendeMacBook-Pro:pygame_sdl2-master aven$ cd ..
AvendeMacBook-Pro:.Trash aven$ cd..
-bash: cd..: command not found
AvendeMacBook-Pro:.Trash aven$ cd ..
AvendeMacBook-Pro:~ aven$ cd pygame_sdl2
-bash: cd: pygame_sdl2: No such file or directory
AvendeMacBook-Pro:~ aven$ which git
/usr/bin/git
AvendeMacBook-Pro:~ aven$ git init help
Initialized empty Git repository in /Users/aven/help/.git/
AvendeMacBook-Pro:~ aven$ git init
Initialized empty Git repository in /Users/aven/.git/
AvendeMacBook-Pro:~ aven$ git clone https://github.com/renpy/pygame_sdl2
Cloning into 'pygame_sdl2'...
remote: Counting objects: 2022, done.
remote: Total 2022 (delta 1), reused 1 (delta 1), pack-reused 2020
Receiving objects: 100% (2022/2022), 1.24 MiB | 933.00 KiB/s, done.
Resolving deltas: 100% (1253/1253), done.
AvendeMacBook-Pro:~ aven$ mkvirtualenv pygame_sdl2
Using base prefix '/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/aven/.virtualenvs/pygame_sdl2/bin/python3.6
Not overwriting existing python script /Users/aven/.virtualenvs/pygame_sdl2/bin/python (you must use /Users/aven/.virtualenvs/pygame_sdl2/bin/python3.6)
Installing setuptools, pip, wheel...done.
/usr/bin/python: No module named virtualenvwrapper
AvendeMacBook-Pro:~ aven$ mkvirtualenv /users/aven/pygame_sdl2
Using base prefix '/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6'
New python executable in /users/aven/pygame_sdl2/bin/python3.6
Also creating executable in /users/aven/pygame_sdl2/bin/python
Installing setuptools, pip, wheel...done.
AvendeMacBook-Pro:~ aven$ cd pygame_sdl2
AvendeMacBook-Pro:pygame_sdl2 aven$ ./bin/pip3 install cython
Collecting cython
Using cached Cython-0.27.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: cython
Successfully installed cython-0.27.3
AvendeMacBook-Pro:pygame_sdl2 aven$ ./bin/python fix_virtualenv.py
AvendeMacBook-Pro:pygame_sdl2 aven$ ./bin/python setup.py install
pygame_sdl2.error is out of date.
pygame_sdl2.color is out of date.
pygame_sdl2.controller is out of date.
pygame_sdl2.rect is out of date.
pygame_sdl2.rwobject is out of date.
pygame_sdl2.surface is out of date.
pygame_sdl2.display is out of date.
pygame_sdl2.event is out of date.
pygame_sdl2.locals is out of date.
pygame_sdl2.key is out of date.
pygame_sdl2.mouse is out of date.
pygame_sdl2.joystick is out of date.
pygame_sdl2.power is out of date.
pygame_sdl2.pygame_time is out of date.
pygame_sdl2.image is out of date.
pygame_sdl2.transform is out of date.
pygame_sdl2.gfxdraw is out of date.
pygame_sdl2.draw is out of date.
pygame_sdl2.font is out of date.
pygame_sdl2.mixer is out of date.
pygame_sdl2.mixer_music is out of date.
warning: src/pygame_sdl2/mixer_music.pyx:58:0: Overriding cdef method with def method.
pygame_sdl2.scrap is out of date.
pygame_sdl2.render is out of date.
running install
running bdist_egg
running egg_info
creating pygame_sdl2.egg-info
writing pygame_sdl2.egg-info/PKG-INFO
writing dependency_links to pygame_sdl2.egg-info/dependency_links.txt
writing top-level names to pygame_sdl2.egg-info/top_level.txt
writing manifest file 'pygame_sdl2.egg-info/SOURCES.txt'
reading manifest file 'pygame_sdl2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'gen/*.c'
writing manifest file 'pygame_sdl2.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.12-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.12-x86_64-3.6
creating build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/__init__.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/compat.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
creating build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/threads
copying src/pygame_sdl2/threads/__init__.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/threads
copying src/pygame_sdl2/threads/Py25Queue.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/threads
copying src/pygame_sdl2/sprite.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/sysfont.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/time.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/version.py -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/DejaVuSans.ttf -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
copying src/pygame_sdl2/DejaVuSans.txt -> build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2
running build_ext
building 'pygame_sdl2.error' extension
creating build/temp.macosx-10.12-x86_64-3.6
creating build/temp.macosx-10.12-x86_64-3.6/gen3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.error.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.error.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.error.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/error.cpython-36m-darwin.so
building 'pygame_sdl2.color' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.color.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.color.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.color.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/color.cpython-36m-darwin.so
building 'pygame_sdl2.controller' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.controller.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.controller.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.controller.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/controller.cpython-36m-darwin.so
building 'pygame_sdl2.rect' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.rect.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.rect.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.rect.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/rect.cpython-36m-darwin.so
building 'pygame_sdl2.rwobject' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.rwobject.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.rwobject.o -D_THREAD_SAFE
gen3/pygame_sdl2.rwobject.c:3012:49: warning: comparison of integers of
different signs: 'unsigned long' and 'Sint64' (aka 'long long')
[-Wsign-compare]
__pyx_t_1 = (((__pyx_v_size * __pyx_v_maxnum) > __pyx_v_left) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
1 warning generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.rwobject.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/rwobject.cpython-36m-darwin.so
building 'pygame_sdl2.surface' extension
creating build/temp.macosx-10.12-x86_64-3.6/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.surface.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.surface.o -D_THREAD_SAFE
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/alphablit.c -o build/temp.macosx-10.12-x86_64-3.6/src/alphablit.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.surface.o build/temp.macosx-10.12-x86_64-3.6/src/alphablit.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/surface.cpython-36m-darwin.so
building 'pygame_sdl2.display' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.display.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.display.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.display.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/display.cpython-36m-darwin.so
building 'pygame_sdl2.event' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.event.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.event.o -D_THREAD_SAFE
gen3/pygame_sdl2.event.c:5863:33: warning: comparison of integers of different
signs: 'Uint32' (aka 'unsigned int') and 'int' [-Wsign-compare]
...= ((__pyx_v_e->type == __pyx_v_11pygame_sdl2_5event_POSTEDEVENT) != 0);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gen3/pygame_sdl2.event.c:3972:18: warning: unused function
'__pyx_f_11pygame_sdl2_5event_make_mousewheel_event_sdl2'
[-Wunused-function]
static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event_sdl2...
^
2 warnings generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.event.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/event.cpython-36m-darwin.so
building 'pygame_sdl2.locals' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.locals.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.locals.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.locals.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/locals.cpython-36m-darwin.so
building 'pygame_sdl2.key' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.key.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.key.o -D_THREAD_SAFE
gen3/pygame_sdl2.key.c:1445:17: warning: assigning to 'uint8_t *'
(aka 'unsigned char *') from 'const Uint8 *' (aka 'const unsigned char *')
discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_state = SDL_GetKeyboardState((&__pyx_v_self->numkeys));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.key.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/key.cpython-36m-darwin.so
building 'pygame_sdl2.mouse' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.mouse.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.mouse.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.mouse.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/mouse.cpython-36m-darwin.so
building 'pygame_sdl2.joystick' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.joystick.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.joystick.o -D_THREAD_SAFE
gen3/pygame_sdl2.joystick.c:2039:14: warning: assigning to 'char *' from
'const char *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_rv = SDL_JoystickName(__pyx_v_self->joystick);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.joystick.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/joystick.cpython-36m-darwin.so
building 'pygame_sdl2.power' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.power.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.power.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.power.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/power.cpython-36m-darwin.so
building 'pygame_sdl2.pygame_time' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.pygame_time.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.pygame_time.o -D_THREAD_SAFE
gen3/pygame_sdl2.pygame_time.c:2047:122: warning: cast to 'void *' from smaller
integer type 'int' [-Wint-to-void-pointer-cast]
...((void *)((int)__pyx_t_2)));
^
1 warning generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.pygame_time.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/pygame_time.cpython-36m-darwin.so
building 'pygame_sdl2.image' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.image.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.image.o -D_THREAD_SAFE
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/write_jpeg.c -o build/temp.macosx-10.12-x86_64-3.6/src/write_jpeg.o -D_THREAD_SAFE
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/write_png.c -o build/temp.macosx-10.12-x86_64-3.6/src/write_png.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.image.o build/temp.macosx-10.12-x86_64-3.6/src/write_jpeg.o build/temp.macosx-10.12-x86_64-3.6/src/write_png.o -L/usr/local/lib -lSDL2_image -ljpeg -lpng -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/image.cpython-36m-darwin.so
building 'pygame_sdl2.transform' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.transform.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.transform.o -D_THREAD_SAFE
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/SDL2_rotozoom.c -o build/temp.macosx-10.12-x86_64-3.6/src/SDL2_rotozoom.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.transform.o build/temp.macosx-10.12-x86_64-3.6/src/SDL2_rotozoom.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/transform.cpython-36m-darwin.so
building 'pygame_sdl2.gfxdraw' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.gfxdraw.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.gfxdraw.o -D_THREAD_SAFE
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/SDL_gfxPrimitives.c -o build/temp.macosx-10.12-x86_64-3.6/src/SDL_gfxPrimitives.o -D_THREAD_SAFE
src/SDL_gfxPrimitives.c:6529:25: warning: passing 'Uint16 [4]' to parameter of
type 'const Sint16 *' (aka 'const short *') converts between pointers to
integer types with different sign [-Wpointer-sign]
polygonColor(m->dst, px, py, 4, m->color);
^~
src/SDL_gfxPrimitives.c:4917:52: note: passing argument to parameter 'vx' here
int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy...
^
src/SDL_gfxPrimitives.c:6529:29: warning: passing 'Uint16 [4]' to parameter of
type 'const Sint16 *' (aka 'const short *') converts between pointers to
integer types with different sign [-Wpointer-sign]
polygonColor(m->dst, px, py, 4, m->color);
^~
src/SDL_gfxPrimitives.c:4917:71: note: passing argument to parameter 'vy' here
...* dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color)
^
2 warnings generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.gfxdraw.o build/temp.macosx-10.12-x86_64-3.6/src/SDL_gfxPrimitives.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/gfxdraw.cpython-36m-darwin.so
building 'pygame_sdl2.draw' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.draw.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.draw.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.draw.o -L/usr/local/lib -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/draw.cpython-36m-darwin.so
building 'pygame_sdl2.font' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.font.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.font.o -D_THREAD_SAFE
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.font.o -L/usr/local/lib -lSDL2_ttf -lSDL2 -o build/lib.macosx-10.12-x86_64-3.6/pygame_sdl2/font.cpython-36m-darwin.so
building 'pygame_sdl2.mixer' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -Isrc -I/usr/local/include/SDL2 -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c gen3/pygame_sdl2.mixer.c -o build/temp.macosx-10.12-x86_64-3.6/gen3/pygame_sdl2.mixer.o -D_THREAD_SAFE
gen3/pygame_sdl2.mixer.c:2392:46: error: use of undeclared identifier
'MIX_INIT_MODPLUG'; did you mean 'MIX_INIT_MOD'?
__pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MODPLUG); if (unli...
^~~~~~~~~~~~~~~~
MIX_INIT_MOD
/usr/local/include/SDL2/SDL_mixer.h:80:5: note: 'MIX_INIT_MOD' declared here
MIX_INIT_MOD = 0x00000002,
^
gen3/pygame_sdl2.mixer.c:2406:46: error: use of undeclared identifier
'MIX_INIT_FLUIDSYNTH'
__pyx_t_8 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLUIDSYNTH); if (u...
^
2 errors generated.
error: command 'clang' failed with exit status 1
I was wondering if the pygame_sdl2 don't support the newest python and macOS system. Anyone met this error?
Finding gen3/pygame_sdl2.mixer.c and performing a replace of MIX_INIT_FLUIDSYNTH with MIX_INIT_MID (I used the
changes referenced above) and removing all constants containing MODPLUG in the name resulted in a successful install. No guarantees on this breaking anything, but MODPLUG looks to have been deprecated in the change.

Can't run mongod command after got pymongo installed from pip

I'm running a virtualenv on osx 10.7.4, and I was trying to install MongoDB for python, which is version 2.7.3.
I just installed it from pip, and am trying to see what happens if I run mongod command, but it turns out I can't run the command.
Below is what happened in my terminal, could anyone give a hand here about what could be wrong?
(test1)Dus-MacBook-Air:~ mepine$ pip install pymongo
Downloading/unpacking pymongo
Downloading pymongo-2.2.1.tar.gz (230Kb): 230Kb downloaded
Running setup.py egg_info for package pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo
building 'bson._cbson' extension
/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/_cbsonmodule.c -o build/temp.macosx-10.4-x86_64-2.7/bson/_cbsonmodule.o
/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/time64.c -o build/temp.macosx-10.4-x86_64-2.7/bson/time64.o
/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/buffer.c -o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o
/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/encoding_helpers.c -o build/temp.macosx-10.4-x86_64-2.7/bson/encoding_helpers.o
/usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.2/lib build/temp.macosx-10.4-x86_64-2.7/bson/_cbsonmodule.o build/temp.macosx-10.4-x86_64-2.7/bson/time64.o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o build/temp.macosx-10.4-x86_64-2.7/bson/encoding_helpers.o -o build/lib.macosx-10.4-x86_64-2.7/bson/_cbson.so
building 'pymongo._cmessage' extension
/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c pymongo/_cmessagemodule.c -o build/temp.macosx-10.4-x86_64-2.7/pymongo/_cmessagemodule.o
/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/buffer.c -o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o
/usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.2/lib build/temp.macosx-10.4-x86_64-2.7/pymongo/_cmessagemodule.o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o -o build/lib.macosx-10.4-x86_64-2.7/pymongo/_cmessage.so
Successfully installed pymongo
Cleaning up...
(test1)Dus-MacBook-Air:~ mepine$ mongod
-bash: mongod: command not found
Thanks guys!!
I think maybe you're confusing the python mongo driver with the mongo server itself.
Did you install mongodb (mongod, mongo, etc.), or just pymongo?
There's a homebrew package for mongodb, just in case you want an easy way to install it--or you can download it directly from http://www.mongodb.org/downloads.

How do I make the Windmill IDE appear for https sites on Ubuntu?

I am trying to use the Windmill Testing Framework over https. I'm running Ubuntu 11.10 with Python 2.7, installing windmill and pyopenssl in a virtualenv via pip. (Installation sequence is included below for reference.)
When I run windmill firefox http://en.wikipedia.org the Windmill IDE comes up fine. When I run windmill firefox https://en.wikipedia.org Firefox starts, but the IDE never appears. (I have verified that when Windmill starts Firefox on Ubuntu, the CA for https is already installed.)
Am I encountering a bug, or is there something else I need to do to get the IDE to work on https addresses?
Installation sequence
myuser#mycomputer:~$ mkvirtualenv --no-site-packages windmill_test
New python executable in windmill_test/bin/python
Installing distribute....................................................................................................................................................................................done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /home/myuser/.virtualenvs/windmill_test/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/myuser/.virtualenvs/windmill_test/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/myuser/.virtualenvs/windmill_test/bin/preactivate
virtualenvwrapper.user_scripts creating /home/myuser/.virtualenvs/windmill_test/bin/postactivate
virtualenvwrapper.user_scripts creating /home/myuser/.virtualenvs/windmill_test/bin/get_env_details
(windmill_test)myuser#mycomputer:~$ pip install pyopenssl
Downloading/unpacking pyopenssl
Downloading pyOpenSSL-0.13.tar.gz (250Kb): 250Kb downloaded
Running setup.py egg_info for package pyopenssl
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Installing collected packages: pyopenssl
Running setup.py install for pyopenssl
building 'OpenSSL.crypto' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/crypto.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/crypto.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/x509.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509name.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/x509name.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkey.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/pkey.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509store.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/x509store.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509req.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/x509req.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509ext.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/x509ext.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkcs7.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/pkcs7.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkcs12.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/pkcs12.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/netscape_spki.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/netscape_spki.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/revoked.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/revoked.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/crl.c -o build/temp.linux-i686-2.7/OpenSSL/crypto/crl.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/util.c -o build/temp.linux-i686-2.7/OpenSSL/util.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/OpenSSL/crypto/crypto.o build/temp.linux-i686-2.7/OpenSSL/crypto/x509.o build/temp.linux-i686-2.7/OpenSSL/crypto/x509name.o build/temp.linux-i686-2.7/OpenSSL/crypto/pkey.o build/temp.linux-i686-2.7/OpenSSL/crypto/x509store.o build/temp.linux-i686-2.7/OpenSSL/crypto/x509req.o build/temp.linux-i686-2.7/OpenSSL/crypto/x509ext.o build/temp.linux-i686-2.7/OpenSSL/crypto/pkcs7.o build/temp.linux-i686-2.7/OpenSSL/crypto/pkcs12.o build/temp.linux-i686-2.7/OpenSSL/crypto/netscape_spki.o build/temp.linux-i686-2.7/OpenSSL/crypto/revoked.o build/temp.linux-i686-2.7/OpenSSL/crypto/crl.o build/temp.linux-i686-2.7/OpenSSL/util.o -lssl -lcrypto -o build/lib.linux-i686-2.7/OpenSSL/crypto.so
building 'OpenSSL.rand' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/rand/rand.c -o build/temp.linux-i686-2.7/OpenSSL/rand/rand.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/util.c -o build/temp.linux-i686-2.7/OpenSSL/util.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/OpenSSL/rand/rand.o build/temp.linux-i686-2.7/OpenSSL/util.o -lssl -lcrypto -o build/lib.linux-i686-2.7/OpenSSL/rand.so
building 'OpenSSL.SSL' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/ssl/connection.c -o build/temp.linux-i686-2.7/OpenSSL/ssl/connection.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/ssl/context.c -o build/temp.linux-i686-2.7/OpenSSL/ssl/context.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/ssl/ssl.c -o build/temp.linux-i686-2.7/OpenSSL/ssl/ssl.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c OpenSSL/util.c -o build/temp.linux-i686-2.7/OpenSSL/util.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/OpenSSL/ssl/connection.o build/temp.linux-i686-2.7/OpenSSL/ssl/context.o build/temp.linux-i686-2.7/OpenSSL/ssl/ssl.o build/temp.linux-i686-2.7/OpenSSL/util.o -lssl -lcrypto -o build/lib.linux-i686-2.7/OpenSSL/SSL.so
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Successfully installed pyopenssl
Cleaning up...
(windmill_test)myuser#mycomputer:~$ pip install windmill
Downloading/unpacking windmill
Downloading windmill-1.6.tar.gz (1.6Mb): 1.6Mb downloaded
Running setup.py egg_info for package windmill
Installing collected packages: windmill
Running setup.py install for windmill
Installing windmill script to /home/myuser/.virtualenvs/windmill_test/bin
Successfully installed windmill
Cleaning up...
(windmill_test)myuser#mycomputer:~$ pip freeze
distribute==0.6.19
pyOpenSSL==0.13
windmill==1.6
wsgiref==0.1.2
http
(windmill_test)myuser#mycomputer:~$ windmill firefox http://en.wikipedia.org
windmill.bin.shell_objects: INFO ['/home/myuser/.mozilla/firefox/p3t9ijqj.mozrunner//mozrunner-firefox', '-profile', '/home/myuser/.mozilla/firefox/p3t9ijqj.mozrunner/', 'http://en.wikipedia.org/windmill-serv/start.html']
Attempts to load http://en.wikipedia.org/windmill-serv/start.html but resolves to http://en.wikipedia.org/wiki/Main_Page . IDE loads.
https
(windmill_test)myuser#mycomputer:~$ windmill firefox https://en.wikipedia.org
windmill.bin.shell_objects: INFO ['/home/myuser/.mozilla/firefox/p3t9ijqj.mozrunner//mozrunner-firefox', '-profile', '/home/myuser/.mozilla/firefox/p3t9ijqj.mozrunner/', 'https://en.wikipedia.org/windmill-serv/start.html']
Attempts to load https://en.wikipedia.org/windmill-serv/start.html and resolves to that pages (which displays a 404 page, which then redirects to https://en.wikipedia.org/wiki/Windmill-serv/start.html - I'm just using Wikipedia as an example here, so it doesn't matter that it returns 404s or "Wikipedia does not have an article with this exact name"). The IDE never loads.
This is not a bug, this was a user error :D
I was running windmill firefox https://www.example.com instead of windmill firefox https://www.example.com ssl

Categories

Resources