I'm trying to build opencv 3 from source(I'm using VS 2013 and compiling for 32bit) so that I can play with feature detection stuff in OPENCV_EXTRA_MODULES with python. My python version is 2.7.5. Everything builds fine except pyopencv_generated. Here's the error log from visual studio. I'm getting vector_Rect2d and boundingBox undeclared identifier errors. VS reports 23 errors in total. All of them can be seen in the screenshot.
Here's the relevant CMAKE screenshot.
Everything else seems to be working OK except this and this is the part that I need unfortunately. Any suggestions? What should I do?
Thanks to berak's comment I was able to fix the issue. It appears that there is some kind of discrepancy between contrib part of the opencv and the installation file provided by opencv. Python enabled build always fails when both of them combined. So I pulled opencv from github rather than using the provided download file.
In short if you are having trouble, pull everything from github rather than using the opencv_download.exe from the opencv.org
Related
I'm using VSCode to create some Python scripts for a personal project. I have used VSCode without any problems in the past but I'm running into some errors now and can't figure out why.
At first I had conflicting Python versions - on the bottom bar it was Python 3.10.2 and when I use the version command in the Terminal I'm getting Python 3.9.7. Originally, I was getting errors that certain libraries were not installed - even if they were - but when I changed the bottom bar version to Python 3.9.7 ('base': conda) which is the same as the version command result - I no longer get that issue.
Instead, I now get an issue that consistently returns something like the following:
File "<stdin>", line 1
/Users/...
^
SyntaxError: invalid syntax
I can get things working on a Jupyter notebook but when I want to use scripts and keep work in folders this is causing a huge problem. Does anyone have an idea what I can do here to resolve?
https://github.com/microsoft/vscode-python
Open this link and install this extension.
Also, a step-by-step procedure is given.
A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: >=3.7), including features such as IntelliSense (Pylance), linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more!
Python extension does offer some support when running on vscode.dev (which includes github.dev). This includes partial IntelliSense for open files in the editor.
I'm using python 2.7.9 and encountered a problem when installing pygtk.
It displayed "Runtime error!...R6034 An application has made an attempt to load the C runtime library incorrectly" when installing numpy/scipy after pygtk being installed.
I tried to figure it out by searching it in stackoverflow and found two similar questions: Runtime error R6034 in embedded Python application and An application has made an attempt to load the C runtime library incorrectly.
So following the first one, I deleted the path corresponding to msvcr90.dll, however, it still cannot work. Then I chose to simply delete msvcr90.dll; at this time, this error wasn't presented when installing numpy/scipy, however, these two modules cannot work when simply typing "importing numpy/scipy".
I also renamed gtk-2.0 following the second one. Then numpy and scipy can be successfully installed. But it displayed "Error processing line 3 of C:\Python27\lib\site-packages\pygtk.pth" when installing matplotlib using pip.
I'm really confused about it. Can anybody provide some methods to fix it?
I've installed Python and PyGTK on 5+ machines, at least two of them brand new, clean builds of Win 7.
I've got the An application has made an attempt to load the C runtime library incorrectly error whenever I install a Python package as a windows installer (rather than using pip) on all these machines. It's annoying, but has never made a jot of difference, both Python and Gtk function correctly.
You've deleted msvcr90.dll, and that is why you get your Error processing line 3... If you look at this file, you'll see that line 3 is import runtime, and if you look further into the 'runtime' package, you'll see that this then tries to find the missing dll.
I think your best bet is to try to restore the missing file. If it's still in your recycle bin - great!
If not, the best thing to do is reinstall the Visual C++ runtime library
I made this video to show my way: https://www.youtube.com/watch?v=s6jhR1VBfeU. I use Anaconda to embedded Python in my C++ application. I simply changed "msvcr90.dll" to "msvcr90.dll_hihi" in 3 folders:
C:\Users\your user\Anaconda2\Library\bin, C:\Users\your user\Anaconda2 and C:\Program Files\Intel\iCLS Client (for x64)
I've run into a strange problem.
I built VTK with python wrappings on cent os 6.5.
On importing vtk it gives me PyUnicodeUCS2_* error. I checked python used for the build for unicode setting with sys.maxunicode. It is UCS4. I searched for this error and found that the error occurs when the VTK is built using UCS2 python. But, This is not the case in my case. What could be the reason for error?
The python that I'm using is picked from some other machine . If I run maxunicode on original previous machine it shows USC2. The same python (I copied the whole folder python2.6) on the other machine where I'm building VTK, shows maxunicode as UCS4. I think this has something to do with the problem.
Please help.
This error is caused by using an extension built by a UCS2-based Python interpreter with a UCS4-based interpreter (or vice-versus).
If you built it using the same Python interpreter then something is confusing in your build environment.
I tried to compile VTK with my python build several times. Checked the various paths in CMAKE to avoid conflict with system python. Still couldn't get rid of the error. Finally, I built the python with --enable-unicoe=ucs2. That solved the problem. Thanks for the help though.
I'm running on a Mac, and I'm trying to get CDAT downloaded to use with Python (and the Anaconda package I have downloaded). I try following along with online sources to set it up, but nothing seems to really help. Can anyone offer any assistance?
I successfully downloaded CDAT_lite and can use to with Python/Anaconda, but the with it is that when I try importing modules cdms2 and regrid2, I got an error message stating that the "image not found"
ImportError: dlopen(/Users/name/anaconda/lib/python2.7/site-packages/cdat_lite-6.0rc2-py2.7-macosx-10.5-x86_64.egg/cdtime.so, 2): Library not loaded: libnetcdf.7.dylib
Referenced from: /Users/name/anaconda/lib/python2.7/site-packages/cdat_lite-6.0rc2-py2.7-macosx-10.5-x86_64.egg/cdtime.so
Reason: image not found
Any help is much appreciated! I'm completely lost and have no idea how to proceed
It looks like there is trouble loading the netCDF libraries.
You need to have the latest release of UV-CDAT (which includes the CDAT libraries). Instructions on how to install them are here: https://github.com/UV-CDAT/uvcdat/wiki/Installation-on-Mac.
Hi this seems to be a rather old version. Please try using our latest version at: http://uvcdat.llnl.gov
Install instructions are at: http://uvcdat.llnl.gov/installing.html
You can either build from source: https://github.com/UV-CDAT/uvcdat/wiki/Build
or simply download the binaries: https://github.com/UV-CDAT/uvcdat/wiki/install
Make sure to read the pre-requisites page first ;)
https://github.com/UV-CDAT/uvcdat/wiki/System-Requirements
With the help of Making Things See I wrote a few programs on Processing for the Kinect. More recently I followed the instructions here for working with the Kinect in vPython. Now the old Processing programs won't run. I get errors when I try to run them. One throws
Null Point Exception: null array
(referring to kinect.depthMap())
Another gives
`SimpleOpenNI Version 0.27
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x60051f35, pid=6924, tid=5692
JRE version: 6.0_37-b06
Java VM: Java HotSpot(TM) Client VM (20.12-b01 mixed mode windows-x86 )
Problematic frame:
C [OpenNI.dll+0x11f35]
An error report file with more information is saved as:
C:\Program Files (x86)\processing-2.0.1\hs_err_pid6924.log
If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help ? Troubleshooting.
I suspect that when I installed Kinect SDK it somehow messed up the drivers I installed for the Kinect to work with Processing. I reinstalled OpenNINITE. What must one do to toggle back and forth between using Processing and Python with the Kinect? (Processing version is 32-bit 2.0.1. Python is 2.7.5)
I reinstalled NITE and then updated the SimpleOpenNi library in Processing. Several of the commands have changed in the new version of the SimpleOpenNI library - e.g. there is no SKEL_PROFILE_ALL parameter - but once I modified my code in Processing, my programs worked and I can also use the kinect in Python.