Building pyV8 ISSUE: Ubuntu 14 64 bit - python

Im trying to install PyV8 from source . I had downloaded v8 from svn and then exported v8 homepath and tried to do a setup.py install on the pyv8 folder . Im getting a host of errors below ...
INFO: Found Google v8 base on V8_HOME </media/DATA/thug-honey/v8>
running install
running bdist_egg
running egg_info
creating PyV8.egg-info
writing requirements to PyV8.egg-info/requires.txt
writing PyV8.egg-info/PKG-INFO
writing top-level names to PyV8.egg-info/top_level.txt
writing dependency_links to PyV8.egg-info/dependency_links.txt
writing manifest file 'PyV8.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'PyV8.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building '_PyV8' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DBOOST_PYTHON_STATIC_LIB -DV8_NATIVE_REGEXP -DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_X64 -I/media/DATA/thug-honey/v8/include -I/media/DATA/thug-honey/v8 -I/media/DATA/thug-honey/v8/src -I/usr/lib/python2.7/dist-packages/boost -I/usr/include/python2.7 -c src/Utils.cpp -o build/temp.linux-x86_64-2.7/src/Utils.o -Wno-write-strings -g -O3
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from src/Locker.h:3:0,
from src/Utils.cpp:11:
src/Exception.h: In constructor ‘CJavascriptStackTrace::CJavascriptStackTrace(v8::Isolate*, v8::Handle<v8::StackTrace>)’:
src/Exception.h:43:43: error: no matching function for call to ‘v8::Persistent<v8::StackTrace>::Persistent(v8::Isolate*&, v8::Handle<v8::StackTrace>&)’
: m_isolate(isolate), m_st(isolate, st)
^
Can any body guide me to get pyv8 working
Or If i can find a debian package for PyV8

Since IMO PyV8 is not well maintained, it only really works with certain combinations of V8 builds and PyV8 builds. Beware of memory leaks as well, I needed to wrap it with some very specific cleanup code to get something stable. This approach is documented in the following issue:
https://code.google.com/p/pyv8/issues/detail?id=229&sort=-id
If I'd start over I would look into doing IPC between a node.js process and a python process to get the same functionality in a more stable and efficient manner.

Related

Cython: fatal error: 'ios' file not found [duplicate]

When I try to install python-pcl(PCL is the point cloud library for presentation like laser radar data. I followed the instruction on https://github.com/strawlab/python-pcl ,and I have already copied travis/pcl-2d-1.8.pc file to /usr/local/lib/pkgconfig folder) in my computer. I typed AppledeMacBook-Pro-3:python-pcl-0.3.0rc1 apple$ python setup.py install in my terminal.Then I encountered a problem below:
running install
running bdist_egg
running egg_info
writing requirements to python_pcl.egg-info/requires.txt
writing python_pcl.egg-info/PKG-INFO
writing top-level names to python_pcl.egg-info/top_level.txt
writing dependency_links to python_pcl.egg-info/dependency_links.txt
reading manifest file 'python_pcl.egg-info/SOURCES.txt'
writing manifest file 'python_pcl.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-x86_64/egg
running install_lib
running build_py
running build_ext
skipping 'pcl/_pcl_180.cpp' Cython extension (up-to-date)
building 'pcl._pcl' extension
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/apple/miniconda3/include -I/Users/apple/miniconda3/include -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/Users/apple/miniconda3/pkgs/python-3.5.4-h8f450c2_22/lib/python3.5/site-packages/numpy/core/include -I/usr/local/include/pcl-1.8 -I/usr/local/Cellar/openni/1.5.7.10/include/ni -I/usr/local/include/pcl-1.8 -I/usr/local/Cellar/flann/1.9.1_6/include -I/usr/local/include/pcl-1.8 -I/opt/local/include/eigen3 -I/usr/include/ni -I/usr/include/vtk-5.8 -I/usr/local/include/vtk-8.0 -I/usr/local/Cellar/vtk/8.0.1/include -I/Users/apple/miniconda3/pkgs/python-3.5.4-h8f450c2_22/include/python3.5m -c pcl/_pcl_180.cpp -o build/temp.macosx-10.6-x86_64-3.5/pcl/_pcl_180.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the
command line to use the libc++ standard library instead
[-Wstdlibcxx-not-found]
pcl/_pcl_180.cpp:447:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
Somebody says it has something to do with my Cython version. But I have already switched Cython to version 0.25.2, still not working. Does anyone have the same problem? Many thanks. By the way, my python version is 3.5.4 and my Mac Version is macOS Mojave 10.14.1
This is a special issue with current MacOS-installations. You could tweak setup.py and add, as the warning suggest, -std=libc++ to the compile-options, i.e.
from distutils.core import setup
from Cython.Build import cythonize
... some stuff
#passing `-stdlib=libc++` to compiler and linker:
ext_modules = [Extension(...,
language='c++',
extra_compile_args=["-stdlib=libc++"], # + anything else you need
extra_link_args= ["-stdlib=libc++"] # + anything else you need]
... some more stuff
I have also added -stdlib=libc++ to the linker options, because it will be probably the next problem you will run into.
More background: In the MacOS world, for long time, there where two different implementations of c++'s standard library: -libstdc++ associated with gcc and libc++ associated with clang. At the beginning-libstdc++ was also used per default with clang-compiler. However, this is no longer the case - it is not even installed now and that is the reason why the headers cannot be found. I'm not sure why your clang-version doesn't take libc++ per default - so you have to pass it manually to compiler/linker.

Installing pycrypto on raspbian for python 3.2.3

Im trying to crate a cryptosystem on the raspbian OS. Chose python and pycrypto because the OS comes with python 3.2.3 pre-installed. Moved the "pycrypto-2.6.1.tar.gz" to the folder where python files are located and extracted there. Suposed to build using the command "python setup.py build" and then install.
But during the build phase, keep getting the error:
"pi#raspberrypi /usr/lib/python3.2/pycrypto-2.6.1 $ python setup.py buildrunning build
running build_py
running build_ext
running build_configure
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/MD2.c -o build/temp.linux-armv6l-2.7/src/MD2.o
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
"
Not able to figure out whether I am supposed to change the pathing. Could somebody give an insight in to this?
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
The libgmp-dev package provides the necessary files to support building the optimized module here:
apt-get install libgmp-dev
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
compilation terminated.
If you search for fatal error: Python.h: No such file or directory, the very first Google result is for this StackOverflow question, which tells you that you need to install the python-dev package:
apt-get install python-dev
In general, if you are building software from source you will need the corresponding -dev package for any required libraries; these packages provide header files (foo.h) and the unversioned shared libraries necessary for linking.

Can't install lxml on OS X 10.8.5

I'm trying to do a malware analysis by using cuckoo sandbox and a VM Machine (WinXP) running on VirtualBox. But however, I can't get cuckoo to run because I haven't installed cybox and maec correctly.
Thus leads me to this problem where I can't get myself to install lxml.
It just won't let me install either by using pip or manual installation with the setup.py file.
Here is what I got:
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.26
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to src/lxml.egg-info/requires.txt
writing src/lxml.egg-info/PKG-INFO
writing top-level names to src/lxml.egg-info/top_level.txt
writing dependency_links to src/lxml.egg-info/dependency_links.txt
reading manifest file 'src/lxml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/lxml.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.8-intel/egg
running install_lib
running build_py
copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.8-intel-2.7/lxml/includes
running build_ext
building 'lxml.etree' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/include/libxml2 -I/Users/ajprameswari/Downloads/lxml-3.4.1/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.8-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'clang' failed with exit status 1
I tried both lxml-3.4.0 and lxml-3.4.1 version but they gave the same result.
I'm using Python 2.7 and OS X 10.8.5. Is there anything that could be pointed to help me solve this issue? I'm a newbie in using OS X, I used to work on my Ubuntu, but due to lack spec of my Ubuntu machine I need to work here.
The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building Python native extensions, where some invalid compiler options are specified.
It seems that the newer version of the llvm compiler shipping is a little more restrictive when it comes to warnings.
Fix:
There is a temporary solution to tell the compiler not to raise this error by setting the following environment variables :
sudo -E export CFLAGS=-Qunused-arguments
sudo -E export CPPFLAGS=-Qunused-arguments

Error installing pymssql on Mac OS X Lion

I have XCode installed and also FreeTDS. I tried to connect to my SQL Server and it works perfect.
Now I have to develop an aplication on python that works with this SQL Server and I´m trying to install pymsql, but I got this error when I launche sudo python setup.py command:
==> sudo python setup.py install
running install
running bdist_egg
running egg_info
writing pymssql.egg-info/PKG-INFO
writing top-level names to pymssql.egg-info/top_level.txt
writing dependency_links to pymssql.egg-info/dependency_links.txt
reading manifest file 'pymssql.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymssql.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-intel/egg
running install_lib
running build_ext
skipping '_mssql.c' Cython extension (up-to-date)
building '_mssql' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/sw/include -Ifreetds/nix_64/include -I/opt/local/include -I/opt/local/include/freetds -I/opt/local/freetds/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mssql.c -o build/temp.macosx-10.7-intel-2.7/_mssql.o -DMSDBLIB
_mssql.c: In function ‘__pyx_f_6_mssql_15MSSQLConnection_convert_python_value’:
_mssql.c:7322: warning: implicit conversion shortens 64-bit value into a 32-bit value
_mssql.c: In function ‘__pyx_f_6_mssql_15MSSQLConnection_get_result’:
_mssql.c:9554: warning: implicit conversion shortens 64-bit value into a 32-bit value
_mssql.c:9566: warning: implicit conversion shortens 64-bit value into a 32-bit value
_mssql.c: In function ‘__pyx_pf_6_mssql_20MSSQLStoredProcedure_2bind’:
_mssql.c:11146: warning: implicit conversion shortens 64-bit value into a 32-bit value
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/_mssql.o -L/sw/lib -Lfreetds/nix_64/lib -L/opt/local/lib -L/opt/local/lib/freetds -L/opt/local/freetds/lib -lsybdb -lrt -o build/lib.macosx-10.7-intel-2.7/_mssql.so
ld: warning: directory not found for option '-L/sw/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib/freetds'
ld: warning: directory not found for option '-L/opt/local/freetds/lib'
ld: library not found for -lrt
collect2: ld returned 1 exit status
ld: warning: directory not found for option '-L/sw/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib/freetds'
ld: warning: directory not found for option '-L/opt/local/freetds/lib'
ld: library not found for -lrt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc6eQsIN.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Any help or clue?
Unfortunately, pymssql's setup.py (as of version pymssql-2.0.0b1-dev-20111019) needs a bit of help to work properly on OSX Lion. The current setup.py tries to compile/link against some pre-built Linux FreeTDS libraries, and also tries to link against librt, which doesn't exist on OSX. Additionally, it only explicitly looks for FreeTDS libraries from Fink or MacPorts, so if you've installed Homebrew (if you use if) or FreeTDS itself in a non-standard location, it may not be located by compiler/linker.
I created a repaired version of setup.py here. It worked well enough for me with the Homebrew build of FreeTDS using the standard locations (/usr/local/{lib, include}), but as always YMMV. You may need to adjust setup.py further if you've installed FreeTDS in a different location. You can generally ignore the warnings from the linker about missing directories that may not exist on your system:
ld: warning: directory not found for option '-L/usr/local/lib/freetds'
One other note: You will probably have built FreeTDS for a single architecture, likely x86_64. By default, pymssl will be a multi-architecture build (assuming you're using the system Python 2.7.1), so even with a patched setup.py you will see a linker warning something like:
ld: warning: ignoring file /usr/local/lib/libsybdb.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
That warning just indicates that the FreeTDS libraries only have single architecture version to link against. You can avoid the warning by using ARCHFLAGS to make a x86_64-only build:
ARCHFLAGS="-arch x86_64" python setup.py install
Or, try this fork, it installs without issues:
https://github.com/blackbass1988/pymssql-macos-lion
To install on OS X Mavericks, you need
OS X Command Line Tools
FreeTDS
brew install freetds
Cython
pip install cython
and then finally you can install the pymssql-macoslion
pip install git+git://github.com/blackbass1988/pymssql-macos-lion.git#master
Just incase anyone is reading this the following worked for me:
brew install freetds
sudo pip install pymssql

lipo: can't figure out the architecture type of: /var/folders/

I tried installing lxml on Mac OSX Snowleopard and keep getting the error:
lipo: can't figure out the architecture type of: /var/folders/
I did install XCode with 10.4 SDK support and I changed gcc 4.2 to 4.0.1
Any clues??? Python 2.6.1 with Leopard 1.6.7..
running install
running bdist_egg
running egg_info
writing src/lxml.egg-info/PKG-INFO
writing top-level names to src/lxml.egg-info/top_level.txt
writing dependency_links to src/lxml.egg-info/dependency_links.txt
reading manifest file 'src/lxml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'lxml.etree.c' under directory 'src/lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src/lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src/lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src/lxml'
warning: no files found matching '*.html' under directory 'doc'
writing manifest file 'src/lxml.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-universal/egg
running install_lib
running build_py
running build_ext
building 'lxml.etree' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/usr/include/libxml2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-universal-2.6/src/lxml/lxml.etree.o -w -flat_namespace
i686-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
i686-apple-darwin10-gcc-4.2.1: no input files
powerpc-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
powerpc-apple-darwin10-gcc-4.2.1: no input files
i686-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
i686-apple-darwin10-gcc-4.2.1: no input files
lipo: can't figure out the architecture type of: /var/tmp//ccCwMxyq.out
error: command 'gcc-4.2' failed with exit status 1
you have an architecture problem for your python, Because of changes in Xcode 4 (dropping of support for the 10.4u SDK and gcc-4.0) it is not practical to build C extension modules with that Python on 10.7 Lion. Either use the Apple-supplied Python 2.7
/usr/bin/python2.7
Install the Python 2.7.3 Mac OS X 64-bit/32-bit x86-64/i386 Installer
I was having the same issue while trying to install milk with Python 2.7. I was not able to get my problem solved with Ali Elouafiq's exact answer, but I was able to get milk installed using the systems Python 2.6.
So perhaps trying other versions of Python until in case it works is a cost effective approach.
I found that compilation issues like these are easily avoided by installing python via brew. If brew isn't able to link the formula, just force it with:
brew link --overwrite python
See also: http://docs.python-guide.org/en/latest/starting/install/osx/

Categories