I am embedding python with boost::python. Everything works fine until I set PYTHONPATH environment variable - then debugger crashes with message
The CDB process terminated
Debugger output
ERROR: Process crashed dCDB PROCESS FINISHED, status 1, exit code
-1073740791 dNOTE: ENGINE ILL ****** dState changed from EngineSetupRequested(1) to EngineShutdownRequested(19) [master] dCALL:
SHUTDOWN ENGINE dNOTE: ENGINE SHUTDOWN OK dState changed from
EngineShutdownRequested(19) to EngineShutdownOk(21) [master] dState
changed from EngineShutdownOk(21) to DebuggerFinished(22) [master]
sDebugger finished.
Qt Creator
Qt Creator 4.5.1 Based on Qt 5.10.1 (MSVC 2015, 32 bit)
Built on Feb 10 2018 04:20:12
From revision 24cd0b1cd6
Qt
5.10.0
Python
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500
64 bit (AMD64)] on win32
VC
Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25835 for x64
PYTHONHOME variable is set and not causing any issues at all.
WORKAROUND: Switched from Qt Creator 4.5.1 to 4.2.2
Qt Creator 4.2.2 Based on Qt 5.8.0 (MSVC 2015, 32 bit)
Built on Apr 3 2017 04:13:59
From revision 991f5eb6a5
https://forum.qt.io/topic/69130/unexpected-cdb-exit/12
#Christoph Schaefer
Related
I'm writing scripts to control test equipment. I've been using the visa library to create handles for the equipment. Everything has been working fine for a while until recently when I try to open my first resource in my code, it takes about 5 minutes before it finishes. Once the first equipment is open, the rest are fine.
The code goes something like:
import visa
rm = visa.ResourceManager()
equip1 = rm.open_resource(equip1_address)
equip2 = rm.open_resource(equip2_address)
I stepped through the code and found that it locks up in a functions.py file, in the open_default_resource_manager(library) function, at this line:
ret = library.viOpenDefaultRM(byref(session))
Here's my "python -m visa info":
Machine Details:
Platform ID: Windows-7-6.1.7601-SP1
Processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
Python:
Implementation: CPython
Executable: C:\python27\python.exe
Version: 2.7.17
Compiler: MSC v.1500 64 bit (AMD64)
Bits: 64bit
Build: Oct 19 2019 21:01:17 (#v2.7.17:c2f86d86e6)
Unicode: UCS2
PyVISA Version: 1.10.1
Backends:
ni:
Version: 1.10.1 (bundled with PyVISA)
#1: C:\Windows\system32\visa32.dll:
found by: auto
bitness: 64
Vendor: National Instruments
Impl. Version: 14680064
Spec. Version: 5243904
#2: C:\Windows\system32\visa64.dll:
found by: auto
bitness: 64
Vendor: National Instruments
Impl. Version: 14680064
Spec. Version: 5243904
For those familiar with Keysight Connection Expert, this is probably related. When I try to open it, it takes forever to load as well. Probably also having trouble locating the equipment?
my problem is with "ModuleNotFoundError: No module named 'cx_Oracle'" when I run connect_oracle.py from CMD in Windows 10.
#conncet_oracle.py
from __future__ import print_function
import os
import cx_Oracle
connection = cx_Oracle.connect("report/pass#ORA")
cursor = connection.cursor()
cursor.execute("select sysdate from dual")
today, = cursor.fetchone()
print("The current date is", today)
But:
when I install cx_Oracle I get
Requirement already satisfied: cx_oracle in c:\users\myuser\appdata\local\programs\python\python37-32\lib\site-packages (7.1.0)
when I run connect_oracle.py in Python 3.7.2 Shell I get good result:
exec(open('H:\Tasks\Python learning\connect_oracle.py').read())
result is The current date is 2019-02-18 11:08:01
when I run it in Spyder I get also good result:
result is The current date is 2019-02-18 11:08:01
when I run print(platform.sys.version) in spyder I get:
3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)]
when I run version.py in CMD I get:
3.7.1 (default, Dec 10 2018, 22:09:34) [MSC v.1915 32 bit (Intel)]
when I run python -v in CMD I get:
Python 3.7.2
I am confuse from this all things. Is it possible that I have more version of Python and it is reason?
How can I solve it?
Thank you
It was maybe my mistake, but when I run in CMD:
python connect_oracle.py
I get good result, so problem is solved, potentially.
But it is weird for me, that in CMD I can run version.py without python with good result but python connect_oracle.py can be use only with python for good result.
Why?
I have an error while connecting my device using GPIB interface by PYvisa.Below is the simple code i run.
>>> import visa;
>>> rm = visa.ResourceManager('C:/Windows/System32/visa32.dll');
>>> rm.list_resources();
('ASRL10::INSTR', 'ASRL71::INSTR')
But i don't see them getting detected as GPIB interface themselves.(like GPIB::25::INSTR).I have installed proper version of python and PyVISA. Below is the output for the same.
C:\>python -c "from pyvisa import util; util.get_debug_info()"
Machine Details:
Platform ID: Windows-7-6.1.7600
Processor: x86 Family 6 Model 58 Stepping 9, GenuineIntel
Python:
Implementation: CPython
Executable: C:\Python34\python.exe
Version: 3.4.3
Compiler: MSC v.1600 32 bit (Intel)
Bits: 32bit
Build: Feb 24 2015 22:43:06 (#v3.4.3:9b73f1c3e601)
Unicode: UCS4
PyVISA Version: 1.8
Backends:
ni:
Version: 1.8 (bundled with PyVISA)
#1: C:\Windows\system32\visa32.dll:
found by: auto
bitness: 32
Vendor: National Instruments
Impl. Version: 14680064
Spec. Version: 5243904
#2: C:\Windows\system32\visa32.dll:
found by: auto
bitness: 32
Vendor: National Instruments
Impl. Version: 14680064
Spec. Version: 5243904
Googling, i found that version and library path may be the possible reasons. But i guess that is not the issue in my case. Can anyone point out where am i going wrong as i am very much new to Python and pyVISA.
Check if your GPIB devices connected/detected via the NIMax panel. If it does not show up on the NIMax then your devices are not connected.
Additionally you should not need to put the visa32.dll path in visa.ResourceManager().
I'm running on OSX Mavericks and have python 3.3.3 installed.
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin)
I'm trying to run this (unfinished) code (a simple HTTPS GET and POST with cookies), but it crashes with an unknown error:
import urllib.request as rqst
import re
import http.cookiejar
def LoginICorsi():
loginUrl = "https://www2.icorsi.ch/auth/shibboleth/"
rqst.install_opener(rqst.build_opener(rqst.HTTPCookieProcessor(http.cookiejar.CookieJar())))
pageBytes = rqst.urlopen(loginUrl)
pageString = pageBytes.read().decode("utf-8")
action = re.findall(r'action="([^"]*)', pageString)[0]
loginPostUrl = "https://wayf.switch.ch" + action
loginPostUrl = loginPostUrl.replace("&", "&")
print("Posting USI to "+loginPostUrl)
postDATA = "user_idp=https://login2.usi.ch/idp/shibboleth".encode("utf-8")
usiLoginRequest = rqst.Request(loginPostUrl)
usiLoginRequest.add_header("Content-Type", "application/x-www-form-urlencoded")
usiLoginUrl = rqst.urlopen(usiLoginRequest, data=postDATA)
usiLoginResult = usiLoginUrl.read().decode("utf-8")
print(usiLoginResult)
The problem is that this code works on Ubuntu
Python 3.3.3 (default, Nov 20 2013, 00:22:18)
[GCC 4.8.2] on linux
so I suppose the code is correct.
Moreover, the code worked on my Mac when I set the system proxy for HTTPS to a proxy with Fiddler.
This is the traceback pastebin.
What am I missing? Does this have something to do with OSX, python, the HTTPS server or just my mac?
The problem arises when handshaking with the server, but I don't why it works on Linux.
Highly, highly recommend you migrate away from urllibs and onto python requests module.
Seriously, it's worth the 5 minutes to easy_install/pip and port your code. It will handle most SSL issues a lot more graceful and a lot less painful.
Objective:
Trying to run SL4A facade APIs from python shell on the host system (windows 7 PC)
My environment:
1. On my windows 7 PC, i have python 2.6.2
2. Android sdk tools rev 21, platform tools rev 16
3. API level 17 supported for JB 4.2
4. I have 2 devices ( one running android 2.3.3 and another android 4.2.2) both running Python for android and SL4A
I'm trying these commands as specified at http://code.google.com/p/android-scripting/wiki/RemoteControl
Here are the commands which i'm trying on the python shell:
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import android
>>> droid=android.Android
>>> droid.makeToast("Hello")
Traceback (most recent call last):
File "", line 1, in
AttributeError: type object 'Android' has no attribute 'makeToast'
Before this i'm performing the port forwarding and starting a private server as shown below
$ adb forward tcp:9999 tcp:4321
$ set AP_PORT=9999
Also set the server on the target listening on port 9999 ( through SL4A->preferences->serverport.
Please help to understand where i'm doing mistake which gives the above error while trying droid.makeToast("Hello") ?
Try
import android
droid=android.Android()
droid.makeToast("Hello")
(you are missing parentheses after android.Android)
Hope you solved the problem. This is what I found, so maybe for somebody else it will be useful.
You need to run all your commands inside the DOS shell...otherwise you will get that error[11001].
If you still want to run you commands outside the DOS shell - add a new environment variable as described here:
http://www.smartphonedaq.com/installation.page