lldb python error - macos

I tried running lldb on my mac and get this at startup:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/embedded_interpreter.py", line 1, in <module>
import readline
ImportError: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
I tried adding the environment variable VERSIONER_PYTHON_PREFER_32_BIT=yes but this error still appears. I'd reckon that the lldb is using a different python environment than it's Mac host so where do I make the change to make it use 32bit mode? thanks.
UPDATE:
I did an arch -i386 lldb and it works in 32-bit. To make it work in 64-bit, I installed a 64-bit version of python readline for OS X but got more problems with native python libraries such as termios and time. So I downloaded python 2.7.3 64-bit installer DMG file and installed its binary; now lldb works in 64 bit finally on my 10.8 mountain lion. Thanks.

It looks like you installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so at some point on your system (I don't see it on my Mac OS X 10.7.5 installation, although maybe it's included in 10.8), and that dylib is only built 32-bit. You can confirm with
file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
on your system. You could try to force lldb to also run in 32-bit mode (the distribution binary is built 32-/64- universal) but instead I would recommend removing that 32-bit-only readline.so from your system unless you really need it there.

For the sake of anyone else coming to this question looking for a quick fix - Linus Oleander's answer worked for me -- that is, run
pip install six
Hazarding a guess as to why this works, I think this smooths over some python incompatibility issues that lldb is facing when running on machines with a 'non-standard' python installation. This also works when using Homebrew's version of llvm.

Related

How to install Vulkan on MacOS BigSur that runs on Mac Mini with M1 chip?

I have a Mac Mini M1 with BigSur os. I am trying to run a program that opens a window from Vulkan tutorial. I downloaded the latest version of Vulkan and folowed the Vulkan Tutorial how to set it up on XCode. I copied the files to a different location as sugested but when I got to the point to link the libraries I cannot find libvulkan.1.dylib in the location they specify and obviuosly I get an error when I run the program that the library is missing: dyld: Library not loaded: #rpath/libvulkan.1.dylib.
I have seen that you can install it using sudo ./install_vulkan.py or simply ./install_vulkan.py from terminal but I am getting this error:
Copying /Users/username/VulkanSDK/macOS/lib/cmake/SPVRemapperTargets.cmake to /usr/local/lib/cmake/vulkan
Traceback (most recent call last):
File "./install_vulkan.py", line 141, in <module>
main()
File "./install_vulkan.py", line 120, in main
os.mkdir(os.path.split(absolute_copy_files[key]["Dest"])[0])
OSError: [Errno 2] No such file or directory: '/usr/local/lib/cmake'`.
I have looked for /usr/local/lib/cmake path but there is no /lib inside the /usr/local/.
I understand that in BigSur the paths are changed and I have seen where the packages are installed via Homebrew. I looks like the new default path is /opt/Homebrew if I am not mistaken. The problem I think is that ./install_vulkan.py doesn't know about these changes from MacOS BigSur.
Does anyone have similar issues with the paths in the new MacOS?
We changed the documentation staring in the 1.2.162.0 release of the VulkanSDK to explicitly state you should use sudo when running ./install_vulkan.py. This is necessary because the program needs to create the needed folders. Technically, you can get away without sudo if you've installed and are using homebrew, which also creates these folders.
Regarding the missing vulkan.1.dylib, this is a mystery from my end. It is a symbolic link to the actual library, so perhaps something has gone awry when extracting the .dmg file or copying the contents out. You can also specifically link directly to the library itself instead (libvulkan1.2.162.dylib if you are using the latest SDK) and not use the symbolic link at all.

compiling esp32 app with eclipse on windows 7: "make" not found

I'm trying to setup my first development for esp32 with eclipse on windows 7.
I installed esp-idf using esp-idf-tools-setup.exe installer which should install
everything needed.
I'm testing with the hello world example app from esp-idf. I can compile it using the python command line
idf.py build
But I need eclipse, it's a bit less obvious... I followed these instructions:
In this page, I can see that there's a need of msys. So I installed
msys2 64 bits.
I copied the xtensa-esp32-elf dir into the "msys64\var\opt" directory to match the PATH variable (and updated it based on the documentation)
Now, when compiling with eclipse, I got the following error:
Traceback (most recent call last):
File "C:/program/esp-idf/tools/windows/eclipse_make.py", line 36, in <module>
main()
File "C:/program/esp-idf/tools/windows/eclipse_make.py", line 29, in main
make = subprocess.Popen(["make"] + sys.argv[1:] + ["BATCH_BUILD=1"], stdout=subprocess.PIPE)
File "C:\python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] Le fichier spécifié est introuvable
Python make is unable to launch "make". The thing is I can't find a make exe anywhere...
This other page states that I must run
make menuconfig
before building with eclipse but, of course, this does not work better for the same reason...
What should I do?
Well, in windows you have nmake (IIRC installed with visual studio tools - or the free where vstools compiler pack). Or you can install something more like gnu-make from one of:
mingw32 : link
cygwin : link
msys2 : link
gnuwin32 : link
There are others as well. Some of these have make command (if you add the bin folder to your path) others will have things like mingw32-make which you may have to alias (I made a batch file called make.bat which just calls mingw32-make %*. But where ever you install make (and nmake IMHO is a really limited poor version of make) you need to add it to your windows path before you run your python script. So in short I think you are just missing a set of tools...
Another option is to just copy ...\MinGW\bin\mingw32-make.exe to ...\MinGW\bin\make.exe
I did add mys2 thinking it will contain everything needed.
In fact msys2 is delivered with a very minimal set of features. I had to install make using the msys2 package manager with the following command:
pacman -S make
Pretty simple when you know!
For esp-idf cmake projects, try this https://github.com/espressif/idf-eclipse-plugin

Setting up google assistant on windows PC

I followed instructions in the below link to set up google assistant in my Windows PC.
https://developers.google.com/assistant/sdk/guides/library/python/
But in the step while running the hotword command, i am getting the below error :
Traceback (most recent call last):
File "c:\users\310211247\appdata\local\continuum\miniconda3\lib\runpy.py",line 193, in
_run_module_as_main
"__main__", mod_spec)
File "c:\users\310211247\appdata\local\continuum\miniconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\310211247\AppData\Local\Continuum\miniconda3\Scripts\googlesamples-assistant-hotword.exe\__main__.py", line 5, in <module>
File "c:\users\310211247\appdata\local\continuum\miniconda3\lib\site-packages\googlesamples\assistant\library\hotword.py", line 27, in <module> from google.assistant.library import Assistant
ModuleNotFoundError: No module named 'google.assistant.library'
How can i resolve this error?
As noted in the Compatibility section for the library, it is only supported on linux-armv7l and linux-x86_64 architectures. The library is not expected to work on a Windows device. Instead, you should look at using the service API.
Google's recommendation is to use the assistant service:
The Google Assistant Library for Python is deprecated as of June 28th, 2019
You can configure the assistant following these instructions:
https://developers.google.com/assistant/sdk/guides/service/python/
After installation to get the hotword working you need to install the assistant library:
pip install google-assistant-library
Then you can run the google assistant with the hotword:
googlesamples-assistant-hotword --project-id project --device-model-id model

python vlc bindings for windows

I am on Windows, and I wish to use Python Bindings for VLC. I've already downloaded the module from https://github.com/oaubert/python-vlc as per the instruction. But, still I can't import the module.
The error looks like this :
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
import vlc
File "c:\python27\python-vlc-1.1.2\vlc.py", line 173, in <module>
dll, plugin_path = find_lib()
File "c:\python27\python-vlc-1.1.2\vlc.py", line 150, in find_lib
dll = ctypes.CDLL('libvlc.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
My aim is to stream the openCV webcam video inside a wxPython window using vlc instance.
I solved the problem myself. I was trying to load a 32-bit dll from a 64-bit process, that's why it doesn't worked out. Finally I am able to fix it by using a 64-bit dll.

Python Ctypes Load Library

I am using windows 7 64 bit machine. I installed Visual studio 2010 and developed a simple win32 dll to add 2 numbers.. The dll is created and i used a test application to test the dll and it works fine..
Now i write python script(shown below) to use this library. But i get the following error message.
Traceback (most recent call last):
File "C:\Users\sbritto\Documents\Visual Studio 2008\Projects\MathFuncsDll\Debug\MathFuncs.py", line 5, in <module>
lib = ctypes.WinDLL('MathFuncsDll.dll',use_last_error=True)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application
Python Script
import ctypes
from ctypes import *
#lib = cdll.LoadLibrary("MathFuncsDll.dll")
lib = ctypes.WinDLL('MathFuncsDll.dll',use_last_error=True)
print lib
Kindly let me know ASAP.
Thanks in advance
You'll get this error if you try to open a 64-bit DLL using a Python interpreter compiled for a 32-bit machine, or vice versa. So, if this is a 64-bit DLL you need to make sure you are running a 64-bit Python.

Resources