Wednesday, April 15, 2020

Linux Panda3D, ImportError: No module named direct.directbase.DirectStart

What to do if you see the Error Message:
ImportError: No module named direct.directbase.DirectStart
This error means it couldn’t find the Python modules – please make sure you are running the correct version of Python (probably Python 3.7, that depends on the Panda3D version) and that the panda3d.pth is located inside the Python site- packages directory.

I got this problem during Panda3D Linux installation. Searching for panda3d.pth also
can not be found. So this is what i done to get the installation to work.
1. follow all steps in the Panda3D website
2. My system is Debian 10 64bit,
    a file panda3d1.10_1.10.0_amd64.deb created
3. After sudo dpkg -i panda3d1.10_1.10.0_amd64.deb
4. set $PYTHONPATH in ~/.bashrc
    export PYTHONPATH=/opt/pythonprj/panda3d/panda3d-src/built:$PYTHONPATH
*/ 'built' depends to the directory where one compile or execute this
    python makepanda/makepanda.py --everything --installer
5. then run the environment by execute $ source ~/.bashrc or exit the terminal
    and relaunch, check with $ echo $PYTHONPATH, shud show the dir set at #4
6.
$ python
Python 3.6.9 (default, Dec 19 2019, 01:20:01) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from direct.showbase.ShowBase import ShowBase
>>>

it works! ^^

Thursday, April 9, 2020

Debian Linux, Wifi disconnect frequently

Just feel so bored with the same problem over and over again, it is my internal Wifi.
It keeps disconnecting frequently. I bought a USB Wifi dongle and it also does not
help very much.

After some googling and found out that there is wifi.powersafe option that could be
set to disabled wifi power safe, link. Immediately set the conf file

$ sudo vim /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

add this in the file if blank:

[connection]
wifi.powersave = 2

And if there is entries, then try to look for the above option and set to 2.
Which you could check for each of the options are

NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave NM_SETTING_WIRELESS_POWERSAVE_ENABLE (3): enable powersave

Then restart the NetworkManager

$ systemctl restart network-manager

My wifi is now working smoothly ^^