Recently I want to work with SURF in opencv, but when I instelled I don't activate the option to have access to the extra modules. So, I donwloaded from https://github.com/opencv/opencv_contrib and then, I followed the steps for installation in:
add extra modules to opencv python?
But when I ran the commands for the first time I got:
CMake Error at CMakeLists.txt:11 (message): In-source builds are not allowed” in cmake
I was read some about it and the problem cames from CMakeCache.txt and has to be removed. I did it and the installation begins, but when finished my terminal shows:
-- Configuring incomplete, errors occurred!
See also "/home/chacho/opencv_build/CMakeFiles/CMakeOutput.log".
See also "/home/chacho/opencv_build/CMakeFiles/CMakeError.log"
Finally I can not run the last step. Which is the best option?...try to fixed or uninstall and install again. I don't know what I did wrong.
Notes:
I have opencv 4.1.2 version
I use Ubuntu 18.04
I work on Spyder
Related
I am trying to install matplotlib with pip command on windows 10 but it is giving me an error and exiting with status 1. I have looked for hours to solve this error but couldn't remove the error. Here is the error.
Then it creates and copy a lot of files in red font.
I'm also getting exit status 2 at the end.
You are missing freetype which is a required external dependency to build python from source which you need to do because we have not posted py38 wheels for Matplotlib (we are working on it).
For now follow the instructions at https://matplotlib.org/devel/contributing.html#retrieving-and-installing-the-latest-version-of-the-code to set the MPLLOCALFREETYPE=1 enviroment variable to have Matplotlib build a local copy of freetype for you. This will be the default behavior in future releases.
I didn't got the proper answer to why it is giving an error or how to solve it but I solved my issue by switching python 3.8.0 to 3.7.5 as suggested by #crissal in the comment section.
I have some installation issues with conan
After my Ubuntu 18.04 told "Command 'conan' not found", I guessed the Python
version is wrong. So I attempted to upgrade with the result
$ sudo apt-get install python
python is already the newest version (2.7.15~rc1-1)
However
$ locate python
/var/lib/binfmts/python2.7
/var/lib/binfmts/python3.6
When in this state I attempted to install conan
$ pip install conan
Collecting conan
...
Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 PyJWT-1.7.1 PyYAML-5.1.2 astroid-1.6.6 attrs-19.1.0 backports.functools-lru-cache-1.5 bottle-0.12.17 certifi-2019.6.16 chardet-3.0.4 colorama-0.4.1 conan-1.18.0 configparser-3.7.4 deprecation-2.0.6 distro-1.1.0 enum34-1.1.6 fasteners-0.15 future-0.16.0 futures-3.3.0 idna-2.8 isort-4.3.21 lazy-object-proxy-1.4.1 mccabe-0.6.1 monotonic-1.5 node-semver-0.6.1 packaging-19.1 patch-1.16 pluginbase-0.7 pygments-2.4.2 pylint-1.9.5 pyparsing-2.4.2 python-dateutil-2.8.0 requests-2.22.0 singledispatch-3.4.0.3 six-1.12.0 tqdm-4.32.2 urllib3-1.25.3 wrapt-1.11.2
then 'conan' is listed as being installed but
$ conan
Command 'conan' not found, did you mean:
I.e, no error message or warning, just does not install.
I could find out that the path was not listed in my PATH, so I added '~.local/bin'. Now the story goes on with the error message
CMake Error at CMakeLists.txt:90 (include):
include could not find load file:
Conan
I found
https://docs.conan.io/en/latest/howtos/cmake_launch.html.
OK, I inserted in my CMakeLists.txt file line
# Download automatically, you can also just copy the conan.cmake file
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(REQUIRES Catch2/2.6.0#catchorg/stable
BASIC_SETUP)
I was also advised,
Please specify in command line CMAKE_BUILD_TYPE
(-DCMAKE_BUILD_TYPE=Release)
So I use
cmake .. -DCMAKE_BUILD_TYPE=Release
rather than
cmake ..
Still, I receive
ERROR: compiler not defined for compiler.libcxx
Please define compiler value first too
FATAL_ERROR;conan install command failed.
STATUS;Conan: Compiler GCC>=5, checking major version 7
STATUS;Conan: Checking correct version: 7
About two weeks ago I could install on another system the same project flawlessly. Can I go back somehow to that state? I expected conan to be stable, rather than alpha.
Edit 2:
I issued
conan profile new default --detect --force
The reply is
Found gcc 7
gcc>=5, using the major as version
************************* WARNING: GCC OLD ABI COMPATIBILITY ***********************
Conan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to
'libstdc++' for backwards compatibility.
Your compiler is likely using the new CXX11 ABI by default (libstdc++11).
(I do not really know why in the case of a new project I need backward compatibility) After that,
cmake ..
finally seems to work. I am afraid I will have further issues due to the compiler standards. For example, SystemC defaults to '98, but some other library uses feature needing '14, and now conan forces to use '11. Is there a way to handle all this centrally, specific to MY system?
Concerning the two python versions: I did not install this manually, only some other install programs did so. I do not really know why and which install script causes such doubling. BTW: Ubuntu said that V2.7 is the newest version, although V3.x is also present. I am a bit confused about these version numbers.
I simply made a new install, and did not especially very WHEN the second version of python appeared. I personally do not even use python, only some install scripts could install it.
Whether my system is specific: I do not think so. I just installed Ubuntu 18.04.2, and my primary goal was to install this SystemC related stuff. I really installed ONLY what was declared as missing. (plus livetex, git, etc.)
In the meantime 'cmake ..' terminated. Appearently, the installation by conan terminated OK. However, when configuring my project, gives messages like
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SCV_INCLUDE_DIRS
The missing files are installed also by conan, using
[requires]
SystemC/2.3.3#minres/stable
SystemCVerification/2.0.1#minres/stable
doxygen_installer/1.8.15#bincrafters/stable
qt/5.12.0#bincrafters/stable
gtest/1.8.1#bincrafters/stable
flex/2.6.4#bincrafters/stable
I am using literally the same files (either my old disk connected to the bus or the new one, using the same cable). The installation made about a month ago runs fine, the new one behaves as described.
It looks like installing and using conan is too complicated for me. I wanted to simplify installation rather than complicate it.
There is a bunch of cases related to installation listed here:
https://docs.conan.io/en/latest/installation.html#known-installation-issues-with-pip
I would say Conan is installed but is not listed in your PATH. You could find Conan in your Python package folder and update your PATH with conan path:
python -m site # list your package folder
find <package folder> -name conan
echo PATH=${PATH}:<package folder> >> ~/.bashrc
source ~/.bashrc
I am trying to run a basic demo from Fenics (2016.2.0) on Ubuntu 16.04.2, Python 2.7, Anaconda (with Spyder for the IDE). The demo is ft_01poisson.py. The error says:
RuntimeError: In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '.../error/dolfin_6c..dc/compile.log'
Ok, let's take a look. Everything is fine until...
.../anaconda2/include/petscsys.h:144:6: error: #error "PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"
# error "PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"
Ok, let's see what the source says:
#elif defined(PETSC_HAVE_MPICH_NUMVERSION)
# if !defined(MPICH_NUMVERSION)
# error "PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"
I track down ~/anaconda2/include/petscconf.h:
#define PETSC_HAVE_MPICH_NUMVERSION 30200300
Now, the version of ~/anaconda2/include/mpi.h that I have in is version 2.2, but I have another version of mpi.h in a mpich-3.2.4 install which does have the correct MPICH_NUMVERSION.
I tried a simple copy and paste of the relevant files and #includes to the ~/anaconda2/include/ folder to no avail (the first error is error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]).
So how do I fix this? How do I get the demo to run after following the instructions to install Fenics?
So, the answer is to work within the FenicsProject Environment as suggested by
conda create -n fenicsproject -c conda-forge fenics
I would delete my own question, but I don't know how. Enjoy everyone!
I am trying to install Jedi for emacs using marmalade package manager by following instructions here -- http://tkf.github.io/emacs-jedi/latest/. The package manger installs Jedi along with its dependencies. But I cannot install python server using:
M-x jedi:install-server
because that command is not available even after restarting emacs after jedi installation. The only available commands are:
Possible completions are:
jedi:ac-setup jedi:complete
jedi:dot-complete jedi:get-in-function-call
jedi:goto-definition jedi:goto-definition-next
jedi:goto-definition-pop-marker jedi:setup
jedi:show-doc jedi:show-jedi-version
jedi:start-dedicated-server jedi:stop-server
jedi:toggle-debug-server
My .emacs has the following:
(autoload 'jedi:setup "jedi" nil t)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
I am using emacs on Mac OS X.
At this current state when I open any python file (I use python 2.7), I see the following appear automatically in the minibuffer:
deferred error : (error Server may raise an error : Traceback (most recent call last):
File "/Users/t_nithyanandan/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py", line 302, in <module>
main()
File "/Users/t_nithyanandan/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py", line 298, in main
jedi_epc_server(**vars(ns))
File "/Users/t_nithyanandan/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py", line 210, in jedi_epc_server
import_jedi()
File "/Users/t_nithyanandan/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py", line 249, in import_jedi
import jedi
ImportError: No module named jedi
)
I tried installing jedi using other methods such as el-get and also manually but those seem to not even go this far. I see that the jedi commands available are even lesser than listed above.
Could someone help point out what I am missing?
Thanks.
Edit: The primary purpose I would like to use Jedi is to use auto-completion features for python programming although I believe Jedi has many powerful features. For such a purpose, is the python server essential or could one work around it? Eventually, of course, I'd like to take advantage of many more features in Jedi.
I managed to fix the problem thanks to help from Chris and syohex from emacs-jedi github. Credit goes to them in tracing this to Jedi version.
I am just linking the discussion on emacs-jedi issue #177 and pasting the workaround I found including other problems I encountered along the way.
I was using the Marmalade version which installs a much older version. So I uninstalled jedi and associated dependencies. I set my repository to MELPA and installed a much more recent version of jedi. This made the command
M-x jedi:install-server
available which wasn't the case earlier.
However, issuing that command gave an error
python-environment--make-with-runner: Program named "virtualenv" does not exist.
I made sure I added the location of virtualenv to PATH in my .bashrc.
So I looked up emacs-jedi issue #158 which suggests installing exec-path-from-shell. I installed it from MELPA and added the lines
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
following instructions.
Restarting Emacs with the above lines gave an error:
Symbol's function definition is void: exec-path-from-shell-initialize
So I looked up Autoload issue #3 under exec-path-from-shell development (the link to this can be found in the link for emacs-jedi issue #177). Following one of the solutions, I restarted my computer, uninstalled and reinstalled exec-path-from-shell which magically did solve the problem that existed before the reboot.
Now I checked in emacs if virtualenv could be found using
M-! which virtualenv
It gave the right location.
Then I ran:
M-x jedi:install-server
which now seemed to run without trouble. The first time, there were messages about setting up a
default virtual environment under
/Users/XXX/.emacs.d/.python-environments
besides
Running: pip install --upgrade /Users/XXX/.emacs.d/elpa/jedi-20140321.1323/...Done
but in subsequent trials only the pip upgrade message was displayed.
Having seen that the server installed without trouble, I closed and restarted Emacs and opened a python script file. When I started editing, I got these messages in the minibuffers:
Error (jedi): Failed to start Jedi EPC server.
*** You may need to run "M-x jedi:install-server". ***
This could solve the problem especially if you haven't run the command yet
since Jedi.el installation or update and if the server complains about
Python module imports.
and
auto-complete error: (error Server may raise an error. Use "M-x epc:pop-to-last-server-process-buffer RET" to see full traceback:
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/XXX/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py': [Errno 2] No such file or directory`
)
Thus, I realized that I have to issue the command:
M-x jedi:install-server
every time I start Emacs before opening any python file. Then I was finally able to see the auto-completion features being available during editing.
Though I can run the above command every time manually, I wanted to automate it from my .emacs whenever Emacs is launched. It turned out that I had the following line in my .emacs
(setq jedi:server-command (list "python" "/Users/XXX/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py"))
Upon removing this line in my .emacs, the problem went away and jedi is functional now.
Marmalade currently contains jedi version 0.1.2, but you're looking at documentation for version 0.2.0alpha2.
The documentation for 0.1.2 has different instructions:
package.el (Marmalade or MELPA)
You can install Jedi.el using package.el interface from Marmalade or MELPA. As package.el does not support installing non-elisp packages, you need to install Python part manually (see the next section).
And then in that next section, the imporant bit:
Install Jedi and python-epc by
make requirements (no need for root privileges) or
pip install -r requirements.txt if you want to determine where to install Python modules. You need root privileges (i.e., sudo) to install it in system directory.
You should be able to do make requirements from the ~/.emacs.d/elpa/jedi-0.1.2/ directory, but something like pip install epc jedi should work too.
I am trying to install wck. But I ran into the following error when running setup.py :
fatal error : tk.h : no such file or directory
But I already have all the -dev packages installed! I went on and installed tk-dev, tk8.5-dev and tk8.4-dev and the problem persists. I did a 'locate tk.h' and there was no tk.h anywhere in my system. Wherever this problem was reported, people were trying to get tcl.h too. So I did a sudo apt-get install tcl-dev and did a 'locate tcl.h'. Nothing! Where did all the header files go?
Your problem is, that WCKs setup.py and setuplib.py don't have a clue where to look with the layout on your system, so you will have to fix those to get it working.
I assume your using some variant of Debian Linux there, so maybe have a look at their guidelines for packaging Tcl/Tk.
Basically they recommend adding configure switches like:
--with-tcl=/usr/lib/tclX.Y
--with-tk=/usr/lib/tkX.Y
--with-tclincludes=/usr/include/tclX.Y
http://pkg-tcltk.alioth.debian.org/tcltk-policy.html/ap-debian_oddities.html
http://pkg-tcltk.alioth.debian.org/tcltk-policy.html/ch-tcltk.html
With that info, you might be able to get it to work by editing setup.py and simply adding a version of find_tk() that works for your system.