Ubuntu 20.04.1 LTS: ERROR: Could not find 'wxe_driver.so' - erlang

maxximiliann#Maxximiliann:$ iex -S mix
Erlang/OTP 22 [erts-10.7.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [
Interactive Elixir (1.10.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :observer.start
12:45:30.511 [error] ERROR: Could not find 'wxe_driver.so' in: /home/maxximiliann/.asdf/installs/erlang/22.3.3/lib/wx-1.9/priv
{:error,
{{:load_driver, 'No driver found'},
[
{:wxe_server, :start, 1, [file: 'wxe_server.erl', line: 65]},
{:wx, :new, 1, [file: 'wx.erl', line: 115]},
{:observer_wx, :init, 1, [file: 'observer_wx.erl', line: 107]},
{:wx_object, :init_it, 6, [file: 'wx_object.erl', line: 372]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}
]}}
These instructions were followed to install erlang-wx on this Ubuntu machine:
Operating System: Ubuntu 20.04.1 LTS
Kernel: Linux 5.4.0-48-generic
Architecture: x86-64
What else is required to get observer to run?

The erlang-wx package is only used by the Erlang installed through Ubuntu packages, but yours was built with asdf. When you asked asdf to build Erlang, it presumably printed this:
* wx : wxWidgets not found, wx will NOT be usable
To fix that, install the package libwxgtk3.0-gtk3-dev, and then remove and reinstall the asdf Erlang installation.

Resharing what solved my problem: :observer.start is not working on Ubuntu answer is from rogerweb
OS: Ubuntu 20.04.4 LTS Focal
Elixir: 1.13.0
Erlang/OTP 25 [erts-13.0.3]
Solution:
sudo apt install libwxgtk-webview3.0-gtk3-0v5

Related

Upgraded pyenv by brew, now only system python activated on new terminal

Yesterday I upgraded pyenv via brew from 1.2.24.1 -> 2.0.3. Since that time now when I open any new terminal window, python is linked to the built in system Python 2 instead of my global pyenv python.
If I do a pyenv virtualenvwrapper in a terminal window, and then create and activate a virtual environment (mkvirtualenv foobar and workon foobar) then my global pyenv Python is activated correctly. Ex:
$ pyenv global
3.9.6
$ which python
/usr/bin/python
$ python
WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using 'python3' from within Terminal.
Python 2.7.16 (default, Mar 25 2021, 03:11:28)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ pyenv virtualenvwrapper
$ mkvirtualenv foobar
created virtual environment CPython3.9.6.final.0-64 in 346ms
creator CPython3Posix(dest=/Users/adam.parkin/.envs/foobar, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/adam.parkin/Library/Application Support/virtualenv)
added seed packages: pip==21.1.3, setuptools==57.1.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
virtualenvwrapper.user_scripts creating /Users/adam.parkin/.envs/foobar/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/adam.parkin/.envs/foobar/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/adam.parkin/.envs/foobar/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/adam.parkin/.envs/foobar/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/adam.parkin/.envs/foobar/bin/get_env_details
$ workon foobar
$ python
Python 3.9.6 (default, Jul 19 2021, 19:04:48)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
But I don't understand why a new fresh terminal isn't using the Pyenv python instead of the system default python?
My path seems to be pointing to the shims directory before /usr/bin, yet a which python is pointing to /usr/bin/python. My path:
$ echo $PATH
/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/adam.parkin/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/adam.parkin/.local/bin:/Users/adam.parkin/bin
As you can see I have the pyenv-virtualenv plugin installed.
The output from the brew upgrade pyenv command when I upgraded can be found in this gist: https://gist.github.com/pzelnip/ca99bf955fe15f66225a41f597501dff
My .bashrc contains the following lines related to pyenv (these are the last 3 lines of my bashrc):
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
If I do a PYENV_DEBUG=1 pyenv init -, the output can be seen in this gist: https://gist.github.com/pzelnip/641a862c19f35571c20fb7d2cb1aabe8
Change eval "$(pyenv init -)" to eval "$(pyenv init --path)" and start a new shell.
Seems like this was a change that was introduced in 2.0

install KIVY for python

I have an error when I run this:
pip install kivy
Here is the error:
Collecting kivy
Using cached Kivy-1.10.0.tar.gz
Complete output from command python setup.py egg_info:
Using distutils
Cython is missing, it's required for compiling kivy !
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-aHd9E8/kivy/setup.py", line 219, in <module>
from Cython.Distutils import build_ext
ImportError: No module named Cython.Distutils
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-aHd9E8/kivy/
So could someone help me to install this python library (for python 2.7 if possible) please, I made my researches and I did not find anything.
Install these:
brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
xcode-select --install
pip install Cython==0.26.1 --user
pip install https://github.com/kivy/kivy/archive/master.zip
You should be able to use kivy on MacOSX high sierra
theecodedragon$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import kivy
[WARNING] [Config ] Older configuration version detected (0 instead of 20)
[WARNING] [Config ] Upgrading configuration in progress.
[INFO ] [Logger ] Record log in /Users/theecodedragon/.kivy/logs/kivy_17-11-09_0.txt
[INFO ] [Kivy ] v1.10.1.dev0, git-Unknown, 20171108
[INFO ] [Python ] v2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
>>>
Edit:
This works with latest version as of now:
theecodedragon$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.1
BuildVersion: 17B48
Try installing Cython:
pip install Cython.
If it doesn't help, you may be using the wrong python installation. Refer to this answer for details.

Ubuntu: downgrade SDL2 version

I'm trying to run a python graphical application made with KIVY framework, then I have this on my terminal:
root#MZs83nQ1:/home/kruqer/Documents/mybackup/Appoff# python appoff.py
[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_17-11-09_5.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0]
Traceback (most recent call last):
File "appoff.py", line 2, in <module>
from kivy.app import App
File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 319, in <module>
from kivy.base import runTouchApp, stopTouchApp
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 30, in <module>
from kivy.event import EventDispatcher
File "/usr/lib/python2.7/dist-packages/kivy/event.py", line 8, in <module>
import kivy._event
ImportError: /usr/lib/python2.7/dist-packages/kivy/_event.x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf
I made researches on google and I found this topic and I need to downgrade my sdl2 version to a version between 2.0.5 and 2.0.6, but I can't see which version am I running actually and don't know how to downgrade it.
My OS is Ubuntu 17.10.
Display SDL Version
Execute the following and it will show you the SDL version that you are using:
dpkg -l | grep sdl
Uninstall
sudo apt-get remove package1 [package2 ...]
Install
Python 2.x/3.x
sudo apt-get install -y \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev
Example - OS: Ubuntu 16.04 LTS (64bits), Python 2.x

Cannot use command line Elixir mix (macOS High Sierra)

When i run command elixir -v or mix, it will return:
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
Crash dump is being written to: erl_crash.dump...done
init terminating in do_boot ()
Some details:
$ brew list
elixir erlang ...
$ erl
Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.0 (abort with ^G)
1>
$ elixir
Usage: elixir [options] [.exs file] [data]
-e COMMAND Evaluates the given command (*)
-r FILE Requires the given files/patterns (*)
...
I have used brew uninstall, reinstall, but nothing change. Please help me fix it!
erl without any arguments will run Erlang shell. But if you want to run Elixir shell you should try running iex (interactive elixir). elixir is used to run programs you already coded, like elixir simple.exs
Or it might be that your Erlang version is little out of date. Try running brew update.

undefined function :wx_object.start/3

I have tried to install ErLang on my Mac 64bit, Capitan, I've tried to install it via brew, but when I try to run :observer.start I get this error:
** (UndefinedFunctionError) undefined function :wx_object.start/3 (module :wx_object is not available)
:wx_object.start(:observer_wx, [], [])
observer_wx.erl:72: :observer_wx.start/0
I also tried to install erLang otp 18.3 using erlang solutions, but I got the same error.
Any idea?
EDIT
If I try to start the observer directly from the Erlang shell:
^CiMac:~ Apple$ erl
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.3 (abort with ^G)
1> observer:start().
** exception error: undefined function wx_object:start/3
in function observer_wx:start/0 (observer_wx.erl, line 72)
EDIT2
iMac:~ Apple$ brew info erlang
erlang: stable 18.3 (bottled), HEAD
Programming language for highly scalable real-time systems
https://www.erlang.org/
/usr/local/Cellar/erlang/18.3 (7,489 files, 273.8M)
Poured from bottle on 2016-05-13 at 12:24:59
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/erlang.rb
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔
Required: openssl ✔
Recommended: wxmac ✔
Optional: fop ✘
==> Options
--with-dirty-schedulers
Enable experimental dirty schedulers
--with-fop
Build with fop support
--with-native-libs
Enable native library compilation
--without-docs
Do not install documentation
--without-hipe
Disable building hipe; fails on various OS X systems
--without-wxmac
Build without wxmac support
--HEAD
Install HEAD version
==> Caveats
Man pages can be found in:
/usr/local/opt/erlang/lib/erlang/man
Access them with `erl -man`, or add this directory to MANPATH.
iMac:~ Apple$ which erl
/opt/local/bin/erl
erl at brew info is:
/usr/local/Cellar/erlang/18.3
but, which erl is:
/opt/local/bin/erl
which points to /opt/local/lib/erlang/bin/erl
if I started /usr/local/Cellar/erlang/18.3/bin/erl observer will work!
so, I deleted the alias by mouse and I:
sudo ln -s /usr/local/Cellar/erlang/18.3/lib/erlang/bin/erl /opt/local/bin/erl
but I am not sure about /opt/local/lib/erlang/bin/erl how it was created..
any way, it works now..
Given the syntax it looks like you are using Elixir :-)
Anyway, one possible answer is that you need Erlang built with WxWidgets, which is the GUI toolkit used by the observer.
If I look at the homebrew formula for Erlang (http://brewformulas.org/Erlang), it shows that it will install the "Wxmac" dependency, so it should bring in WxWidgets...
What happens if you try to start the observer directly from the Erlang shell as follows?
1> observer:start().
(I have installed it with MacPorts and it works out of the box).
EDIT
It really looks like that Erlang doesn't have WxWidgets. You can try brew info erlang, it will show you which version is installed and wether the wxmac dependency is installed or not.
Are you sure actually you are starting the right erl? The one installed by brew? (does "which erl" in the console print the expected path?)
On many systems Erlang with wx isn't supported by default. It can be enabled by a compilation option. Sometimes there is a separate package that has been compiled with wx support, e.g. erlang-wx on FreeBSD.
A quick Google search shows this example article that provides some info about recompiling Erlang on Mac with wx enabled.

Resources