Error opening libpython3.9.s0.1.0 on raspberry pi - python

I'm trying to run a program that was originally compiled for x86 processors on my raspberry pi, I tried to use the box86 emulator which I installed to launch it but it is returning a long list of errors of the following type.
"Error: Global Symbol XML_SetEncoding not found, cannot apply R_386_BLOB_DAT #0xba19f98 ((nil)) in ~/program/libpython3.9.so.1.0"
and ending with
"Error loading Python lib '/program/libpython3.9.so.1.0': dlopen Cannot dlopen("/program/libpython3.9.so.1.0"/0xb6380560, 102)
I can't find any reference to these type of errors and am unsure if it is something in the setup or due to the box86 emulator? The program I am running is initialised from a .sh and runs a python script, and the libpython3.9.so.1.0 file is located in the directory it is looking in.
I know this is not the best way to go about this but I have been tasked with getting the program running on a pi and if it proves impossible I can try to purchase an industrial pc for the task but I would like to try with this first, My next step will be attempting to see if using exagear may help but assistance with these errors would be useful first.
Edit: I have not done any configuration of python or the path since setting up the Pi, however the file i am running starts with #!/usr/bin/env/ bash

Related

Running pyinstaller on Ubuntu 20.04 creates file not able to run properly

I'm working on a VirtualBox Machine running Ubuntu 20.04 as the software. I'm using the virtual machine to create executable scripts using pyinstaller that will work across several platform types.
What Happens
Using the terminal, I run python3 -m PyInstaller --onefile "filename.py", which works as it should and creates a single file of the program. However, the name of the program is just that, the name. There is no file type associated with it and the end is just blank. For example, if the program name is program v.1.0.py, the executable's name is program v.1.0. Once I click on it, it will not run and nothing will show up. The log file I have set up shows the error CRITICAL: Program experienced unexpected error. Program terminated with EOF when reading a line. From my research, I understand this can happen when there is an input clause that is not fulfilled, which makes sense as the first line of the code begins with an input line.
What Should Happen
The executable should pop up a terminal dialogue as it does on my Debian and Windows devices, but instead, I get nothing, not even an indication of something going wrong. If anyone has experience with something similar and an idea of how to fix it, I would appreciate the help.

Python is searching in the wrong user folder

I am running a python script with Process.Start from c#. The program works correctly on my main PC however when I try to run it on another computer it comes up with this error:
No Python at 'C:\Users\[User name on main Pc ]\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe'
How could I solve this?
It seems that Python is not installed on the other PC. That's why your script is not working. You need to install Python first, so your PC is able to interpret your code.

Error while Registering the script to be run at start-up, how to resolve?

I am from electrical engineering and currently working on a project using UP-Board, I have attached LEDs, switch, Webcam, USB flash drive with it. I have created an executable script that I want to run at startup.
when I try to run the script in terminal using the code sudo /etc/init.d/testRun start it runs perfectly. Now when I write this command in terminal sudo update-rc.d testRun defaults to register the script to be run at startup it gives me the following error
insserv: warning: script 'testRun' missing LSB tags and overrides
Please guide me how to resolve this? I am from Electrical engineering background, so novice in this field of coding. Thanks a lot :)
The thing to remember is that you run the script as you but like chron startup does not, so you need to:
Ensure that the executable flags are set for all users and that it is in a directory that everybody has access to.
Use the absolute path for every thing, including the script.
Specify what to run it with, again with the absolute path.

Debugging from PyCharm to Visual Studio C++ code

I'm currently trying to debug issues in Caffe for Windows PyCaffe.
Because of a bug in Python Tools for Visual Studio, PTVS doesn't work so I'm using PyCharm and trying to attach to PyCaffe's process through Visual Studio 2013. That is, I'm running PyCharm debugger on a Python script with a breakpoint set at the point where I call the Python entry point into PyCaffe.
I debug the Python script in PyCharm which calls modules written in C++ in VS. I want to debug those modules in C++. So I'm trying to attach to the PyCharm or Python processes with breakpoints set in VS.
The problem is that the breakpoint isn't firing at the entry point in PyCaffe in the Visual Studio C++ code.
Has anyone successfully gotten this kind of thing to work or is there an alternative way of doing this?
I faced a similar problem a few years ago, trying to
debug a user-mode driver wish was loading automatically from a RPC, the solution I found was:
Download Debugging Tool for Windows (depending on your system x86 or x64), wish is free,from the Microsoft Download.
Add "__asm int 3"(this is asm instruction for a hardware breakpoint) in the place on the C code where you whant to the break point to take effect.
Compile the C program, nomally with debug info (this part is important,because help the Debugger to find the source file), this should not make any problems.
Attach the Debugger to the running process (in my case was the explorer process), in your case should be the process that make first call to the library, for example if PyCharm create a process for the new python code, the debugger need to be attached to that process(you can manage this by setting a breakpoint in python, wish will give you time for doing the attach process), the easy way for me to figure this out was to let the process crash, because "__asm int 3" cause a process crash if a debugger is not attach, you can take advantage of this waiting for the crash and when windows shows you the screen "Process ... has detected a problem an need to be closed", you know who is the process that you are looking for.
This could be painful the first time but for me quite effective, because you
can see the data flow from one program to another,
We attach to one process and allow to set breakpoints within code that has not started from the VS debugger. But one important issue is that we often debug/run the app in the VS, for example, we debug the Web code that runs under IIS, we will attach to the IIS process or others.
Your project is different from the above sample, you run/debug your app in Pycharm (not the VS), but you want use the VS Attach to process function, so it would have a limitation. As you said that you debug script in PyCharm, and want to call C++, so you would check that whether the PyCharm supports a similar feature like the attach tool in VS.

Distributing python-written executable with veusz

I would like to distribute an application written in python as a .exe file. I have already been able to do this using py2exe, but now I have incorporated the veusz library into my code. Ideally my program should open up a veusz plot (as it does on my computer, which has python, numpy, etc. all installed). However, I want to distribute an executable that does this without having to install python.
When I try running my setup.py with py2exe, everything goes fine and the exe is built. However, once the application runs and gets to the point where it is to display the graph, it sends up:
Runtime error: Unable to find veusz executable on system path.
Can I fix this without having to install a bunch of stuff on my clients' computers? Is this possible? And if I must install something, what is the minimum amount of software I need to install?
Veusz runs its user interface in a separate python process so that it does not block python. If you look at veusz/embed.py, it tries to start up python or a veusz executable. You'd need to modify embed.py to start your .exe (sys.executable) if frozen instead of veusz and pass some special parameter which your program would interpret to start running veusz.embed_remote.runremote.
The python multiprocessing module has to do something similar - you need to call a multiprocess function which checks whether the program was starting by multiprocessing - to get around the fact that Windows doesn't have a working fork.

Categories