I am trying to install PyVlFeat and the installation is failing with exactly this issue mentioned here.
pyvlfeat error during installation: /usr/bin/ld: cannot find -lboost_python-mt-py26
As per the answer mentioned there, I need to change the reference of "-lboost_python-mt-py26" to the correct version of Boost Python I have on my system.
I am on ubuntu 14.04 and I tried to detect the version of my boost python by using this command "ls /usr/lib/libboost_python*"
I don't seem to have any libraries with a similar name there. However, I have installed Boost Python using this command "sudo apt-get install libboost-all-dev" as mentioned here.
https://stackoverflow.com/questions/25891667/boost-undefined-reference-ubuntu-14-04-boost-1-54
Since Boost Python is already there, how should I use it correctly to compile PyVlFeat.
The -mt suffix had been removed from Boost Libraries. The installed Boost libraries are multi-threading safe.
Changing the reference to "-lboost_python-py27" (Removing -mt suffix and using proper version of python will solve the problem.
Related
I'm trying to start with OpenCV with python. I have experience c# and I have knowledge of c++. However, I feel more comfortable with python instead of c++. I installed OpenCV then python 3.4 in visual studio 2015. At the beginning I've received an error numpy, "Module couldn't be found", thankfully, I resolved it. The I got another error cv2 "Module couldn't be found" I asked an question yesterday, but I think the question has been left away. Anyways, I'm not complaining, but I still need some help please to stat with OpenCV in python.
Installing python 3.4 Successful
Installing numpy Successful
installing matpilotlib Failed
installing cv2 Failed
can anybody help me please thanks a lot.
It's very common to install Python packages through pip today (recursive acronym for pip installs packages). However, this is not that trivial under Windows.
How to install matplotlib:
Try to open a commandline and type in pip install matplotlib. If this does not work, you'll need to do some more work to get pip running. I gave a detailed answere here: Not sure how to fix this Cmd command error?.
How to install OpenCV:
The Python OpenCV DLL must be made for your version of Python and your system architecture (or, to be more specific, the architecture your Python was compiled for).
Download OpenCV for your Python version (2/3)
Try replacing the x64 version with the x86 version
There are a lot of different binaries here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv. Try to get the one exactly matching your Python version and System architecture and install it via pip (cp35 means CPython version 3.5 ect.).
If you have the OpenCV .whl file matching your system configuration, do pip install file.whl.
Hope this helps!
You can install matplotlib using pip (which is already installed on your machine - mentioned in your previous quesiton):
pip install matplotlib
more info:
http://matplotlib.org/faq/installing_faq.html
You may be better off using an package such as pythonxy as a start, e.g. from https://python-xy.github.io/ , instead of installing each single package manually.
I've just installed PyPy on Windows and seen an approximately 10x speed improvement in some simulation code I'm running. I'd like to see similar on code using numpy, too. I'm not an experienced Python programmer however and I'm finding the instructions hard to follow. Does anyone know if installing numpy for PyPy on Windows is possible and if so what's the easiest way to do it?
The instructions provide two options.
Option no 1
If you have pip (the command-line assumes that it finds the pip belonging to PyPy, not the one from CPython):
pip install git+https://bitbucket.org/pypy/numpy.git
this seems like a great option but I can't find pip in the directory structure I unzipped into.
Option no 2
Alternatively, the direct way:
git clone https://bitbucket.org/pypy/numpy.git
cd numpy
pypy setup.py install
I haven't got git on Windows, but also I'm suspicious this option might involve compiling source code from https://bitbucket.org/pypy/numpy.git, and might not even be possible (or require a lot of hacking) on Windows.
Edit
Installing pip via https://sites.google.com/site/pydatalog/python/pip-for-windows as per the answer below, or the instructions in this answer to the question How do I install pip on Windows?, failed with ConnectionError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /packages/py2.py3/p/pip/pip-1.5.4-py2.py3-none-any.whl (Caused by <class 'httplib.BadStatusLine'>: ''). See, e.g., this bug report. However I was able to install pip via Microsoft Visual Studio PTVS by right-clicking PyPy 2.7 under Python environments in Solution Explorer, selecting Install Python Package. This failed to install numpy (with another connection error) but did install pip.
Now that I have pip, I tried to install numpy on the command line using pip install git+https://bitbucket.org/pypy/numpy.git. First of all I needed to install git to do this... no problem. But then it failed with the following
building library "npymath" sources
No module named numpy.distutils.msvccompiler in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat
I'm unfamiliar with installation of Python packages and I'm not sure what this means. I do have Visual Studio 2012 with the C++ compiler installed, but on the other hand this thread for Python 3.3 (I'm using 2.7 at the moment) seems to imply that a C++ compiler shouldn't be needed.
Edit
This seems to be nothing to do with pip installation. Following option 2
git clone https://bitbucket.org/pypy/numpy.git
cd numpy
pypy setup.py install
I still get Unable to find vcvarsall.bat. However, taking a hint from this answer, vcvarsall.bat can be found if you set the environment variable VS90COMNTOOLS to the appropriate directory. In my case I have VS2012, so the appropriate line is
set VS90COMNTOOLS=%VS110COMNTOOLS%
Now the compiler can be found but there is a compile error
_configtest.c
_configtest.c(4) : error C2061: syntax error : identifier 'npy_check_sizeof_type'
_configtest.c(4) : error C2059: syntax error : ';'
_configtest.c(7) : error C2065: 'npy_check_sizeof_type' : undeclared identifier error:
It seems like this is a file generated during the compile process that probably doesn't even need to be built. Nevertheless I think I might be really stuck now...
For the first option you should download pip from
https://sites.google.com/site/pydatalog/python/pip-for-windows
After that you should add in enviroment variable PATH the path of the pip.
Finally , you should use command prompt and use the
pip install git+https://bitbucket.org/pypy/numpy.git
I don't think there would be any difference for numpy: Pypy is designed to speed up native python code, whereas numpy is written in C (as well as python) and is likely already compiled to maximise speed.
I have just installed python (2.7.4) with brew on my macbook pro (10.7.5).
I also installed exiv2 and pyexiv2 with brew.
When I import pyexiv2 from the python interpreter, I got the following error :
Fatal Python error: Interpreter not initialized (version mismatch?)
What I should do to correct that (considering that I do not want to remove the brewed python as suggested in this thread:
How to install python library Pyexiv2 and Gexiv2 on osx 10.6.8?)
Thanks a lot for any advice !
After much searching and looking at a few complicated solutions across the web, I found a simple method to solve this problem, in the Homebrew wiki itself!
The root of the problem is the boost dependency library, which by default links to the system python and not a brewed python, from the wiki:
Note that e.g. the boost bottle is built against system python and should be brewed from source to make it work with a brewed Python. This can even happen when both python executables are the same version (e.g. 2.7.2). The explanation is that Python packages with C-extensions (those that have .so files) are compiled against a certain python binary/library that may have been built with a different arch (e.g. Apple's python is still not a pure 64bit). Other things can go wrong, too. Welcome to the dirty underworld of C.
(emphasis mine)
So first uninstall the dependency libraries and pyexiv2 itself with:
brew rm $(brew deps pyexiv2)
brew rm pyexiv2
Then install boost from source as indicated here:
brew install boost --build-from-source
Note: building boost might take time, so be patient, it took my system 27.9 mins! (output below)
usr/local/Cellar/boost/1.54.0: 9865 files, 568M, built in 27.9 minutes
Then reinstall pyexiv2 and dependencies:
brew install pyexiv2
That's it, now importing pyexiv2 should work flawlessly.
Check which Python you are running (which python), and run python with the -v option to see where it is looking for modules. Check that all those things match your expectations. Then run brew doctor, and if that doesn't complain about anything, report a bug.
I had a bunch of trouble installing pyexiv2 with Homebrew on macOS Sierra using bool.dev's answer above. The Homebrewed pyexiv2 kept throwing a Segmentation Fault 11 on import.
I eventually got it installed and working with the Homebrewed Python by modifying bool.dev's answer with the following commands:
brew install boost --build-from-source
brew install boost-python
brew install exiv2
sudo pip install git+https://github.com/escaped/pyexiv2.git
I found the last line in the following document on Page 30 after getting sucked down a Google hole.
Hope this helps!
I am attempting to set up my Django virtualenv production environment on a Linux shared host server. Installing python packages using pip goes fine until I try to install Mysql-Python, which crashes. Does anyone know why this is failing? Looking through the error log, I think it's an architecture incompatibility between the package and my python installation because of these lines:
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: warning: i386 architecture of input file build/temp.linux-x86_64-2.4/_mysql.o' is > incompatible with i386:x86-64 output build/temp.linux-x86_64-2.4/_mysql.o: In function _mysql_field_to_python':
I was told the server is 64-bit and is running Python 2.4, although I'm not sure how to double-check the former. Ive been googling this issue for several hours but I've only found references to install/import errors on macs. I'm thinking perhaps I need to compile a different version of MySQLdb instead of just doing pip install -E myvirtualenv MySQL-python but I'm unsure. Any help is greatly appreciated.
If you can't get the same architecture through pip or your package manager, you will probably need to either recompile Python (which you might consider anyway -- Python 2.4 is old), or MySQLdb.
Unfortunately, a lot of Python libraries are not cross-compatible between i386 and x86_64 -- I've actually had exactly the same issue with HGSubversion (the actual issue was with subvertpy, but I needed that for hgsubversion) and cx_Oracle. My solution was to downgrade Python to 2.6 for i386. Stunk.
i am trying to install pygtk on my mac which then asked me to install pygobject which then asked me to get gobject-introspection . the problem i have in this installation is while configuring it shows this error :
checking for FFI... no
checking for ffi.h... configure: error: ffi.h not found
please do help me with this as i need to get gtk .
/usr/include/ffi->location of ffi.h
thanks in advance
Try this:
export FFI_CFLAGS=/usr/include
export FFI_LIBS=/usr/lib
then
./configure
I hope this solves your problem.
I initially found this compile failure while assembling GLib (all versions I tried that were more recent than 2.28.7), but I again encountered it with gobject; and it appears related to several other packages' build failures:
http://lists.gnu.org/archive/html/guile-gtk-general/2006-10/msg00010.html
Weird error when installing GLIB
http://lists.freebsd.org/pipermail/freebsd-gnome/2011-August/026346.html
I tried following the advice provided in all of these threads (as the solutions discussed are largely the same) with no success.
The Final Solution: a complete recompile and install of GCC (4.7.2)
Why did compiling GCC (4.7.2) solve the issue?
I found this post in the Debian Bug Archive: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523869
While reading, I noted that my system was using an affected version of GCC to compile my various sources (from an FC9 installation on a relic laptop).
I chose 4.7.2 as my goal because it was, at the time of this writing, the most current build in the stable tree. I'm relatively sure that a simple package install of a recent GCC on your system will yield the same results (so long as you get 4.3.5-4 or later), but I haven't tested this as there are understandably no such packages for an FC9 install. The package route has many potential positive aspects beyond being easy, please read below..
Important Note: If you are trying to compile GCC, you'll probably need a working (and current) glibc enviroment... Please read up on this complication BEFORE you start the manual process: http://cygwin.com/ml/libc-alpha/2012-02/msg00646.html
The workaround is to find a Glibc version that predates the commit noted in the article above (i went with 2.14), compile GCC 4.5 with that installed (i chose 4.5.3 due to release proximity with glibc 2.14), and then start the process again with current Glibc and GCC... best of luck!
GCC: http://ftp.gnu.org/gnu/gcc/
Glibc: http://ftp.gnu.org/gnu/glibc/
Binutils: http://ftp.gnu.org/gnu/binutils/
ffi.h is provided by the package libffi-dev, which is actually from the gcc source package. and most probably it's available for linux.