How do you properly create a pythonpath for a mavlink environment? - python-3.x

For a project I am currently trying to install Mavlink onto a Linux Ubuntu (v20.04.4) using Oracle Virtualbox (v6.1) using python (v3.8) on a machine named test with the user named test. Using the given instructions provided by Install Mavlink, it states to set pythonpath as PYTHONPATH=path_to_root_of_cloned_mavlink_repository. But no matter what I try ranging from ='/home/test/mavlink/pymavlink' to =home/test/mavlink, there has been no indication that it is properly working as no feedback is given after the command and modules are still not being found by the terminal. So my question is if I am using the right command for my versions of programs or if I am even doing the file path right by linux standards. The file path given after downloading the github mavlink repository is "Cloning into '/home/test/mavlink/pymavlink'..."

Related

Is there any method to know which enviroment variables is trying to read a linux program?

I'm trying to install a software in Ubuntu 20.04. When running the setup, an error occurs because it's trying to write a log file in root folder.
This error was not present when I installed the same program in Ubuntu 16.04. Even, without running it as root.
I suspect that the installation program is trying to read some enviroment variable that not longer exists in this version, and it's trying to locate the log files in root folder by default.
Is there any method to know which enviroment variables is trying to read a binary file?
Try strace, it will tell you all calls to OS.

selenium-webdriver: The geckodriver executable could not be found on the current PATH

I installed the selenium webdriver using the following command:
$ npm i selenium-webdriver
Then, I created the directory D:\WebDriver\bin (and added the files geckodriver.exe and operadriver.exe to that directory) and added it to the system's PATH variables.
The PATH to the directory that contains both drivers was successfully added, as can be seen below:
$ printenv PATH
/mnt/d/WebDriver/bin/
$ ls "/mnt/d/WebDriver/bin/"
geckodriver.exe operadriver.exe
I am also able to run the geckodriver via cmd.exe (Same applies to operadriver):
C:\Users\user>geckodriver
1621873805268 geckodriver INFO Listening on 127.0.0.1:4444
When I try to run one example file (google_search) via:
/mnt/d/proj/node_modules/selenium-webdriver/example $ node google_search.js
I receive the following stacktrace:
Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from https://github.com/mozilla/geckodriver/releases/ and ensure it can be found on your PATH.
The operadriver also cannot be found when setting up an example that uses the opera driver.
Worth mentioning is that I use a Windows Subsystem for Linux (WSL) and ran the commands (node, printenv and npm) in the terminal of that subsystem. The path variable was set on the Windows system and the required drivers were only installed on the Windows system. I can access the installed files on my windows system via the WSL terminal, but selenium still cannot find the specific driver(s).
When I run the above mentioned test file (google_search.js) from selenium-webdriver on the Windows system, it does find the web driver and works as expected. I still cannot figure out the reason why the driver is not being found in the WSL.
I was able to resolve the problem using the following well written article: https://qxf2.com/blog/setup-linux-testing-environment-on-windows-using-wsl/. By creating symlinks that point to the driver and the web driver executable, the driver and the web browser was found. For now, I do think it's easier to run the tests in cmd.exe, though, as it does not require these additional steps.

Cross-compile node module with native bindings with node-gyp

I'm using AWS Lambda, which involves creating an archive of my node.js script, including the node_modules folder and uploading that to their infrastructure to run.
This works fine, except when it comes to node modules with native bindings (using node-gyp). Because the binding was complied and project archived on my local computer (OS X), it is not compatible with AWS's (Amazon Linux) servers.
How can I cross-compile/install a node module (specifically, node-sqlite3) so when I upload it to another server arch it runs?
While not really a solution to your problem, a very easy workaround could be to simply compile the native addons on a Linux machine.
For your particular situation, I would use Vagrant. Vagrant can create virtual machines and configure them within seconds.
Find an OS image that resembles Amazon's Linux distro (Fedora, CentOS, others that use yum as package manager - see Wiki)
Use a simple configuration script that, when run by Vagrant on machine startup, will run npm install (optionally it might also remove the node_modules folder before to ensure a clean installation)
For extra comfort, the script can also create the zip file for deployment
Once the installation finishes, the script will shutdown the VM to avoid unnecessary consumption of system resources
Deploy!
It might require some tuning if the linked libraries are not at the same place on the target machine but generally this seems to me like the best and quickest solution.
While installing the app using Vagrant might be sufficient in some cases, I have found it necessary to build the app on Linux which is as close to Lambda's Amazon Linux AMI as possible.
You can read the original answer here: https://stackoverflow.com/a/34019739/303184
Steps to make it work:
Spawn new EC2 instance. Make sure it is based on exactly the same image as your AWS Lambda runtime. You can review Lambda env details here: http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html. In our case, it was Amazon Linux AMI called amzn-ami-hvm-2015.03.0.x86_64-gp2.
Install nvm and use it to install the same version of Node.js as on the AWS Lambda. At the time of writing this, it was v0.10.36. You can refer to http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html again to find out.
You will probably need to install git & g++ compiler on the EC2. You can do this running
sudo yum install git gcc-c++
Finally, clone your app to your new EC2 and install your app's dependecies:
nvm use 0.10.36
npm install --production
You can then easily download the node_modules using scp or such.
Same lines as Robert's answer, when I had to work on my MAC in a different OS I use vm ware like Oracle's free virtualizer VirtualBox to get a linux on my mac, no cost to me. Or sign up for a new AWS account, you get a micro for a year free. Use that to get your linux box, do whatever you need there.
AWS has a page describing how to deal with native NPM modules: https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/

SIP install - unable to open siplib.sbf

I'm trying to install SIP on my computer so I can proceed to get PyQt. I put the install files in a folder on my desktop ('C:\Users\User\Desktop\Programming\Sip\sip-4.15.5'). So, to install it, I ran the following commands from CMD:
cd C:\Python33
python "C:\Users\User\Desktop\Programming\Sip\sip-4.15.5\configure.py"
The version of python in 'C:\Python33' IS the one used in the command 'python'. Here's the output I got:
This is SIP 4.15.5 for Python 3.3.5 on win32.
The SIP code generator will be installed in C:\Python33.
The sip module will be installed in C:\Python33\Lib\site-packages.
The sip.h header file will be installed in C:\Python33\include.
The default directory to install .sip files in is C:\Python33\sip.
The platform/compiler configuration is win32-msvc2010.
Creating siplib\sip.h...
Creating siplib\siplib.c...
Creating siplib\siplib.sbf...
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
Error: Unable to open
"C:\Users\User\Desktop\Programming\Sip\sip-4.15.5\siplib\siplib.sbf"
Now, the key lines are obviously the last two, so I looked in the appropriate folder and found that there was a rather good reason for the error: there is no "siplib.sbf." The closest it gets is "siplib.sbf.in". What on earth is going on? If this is a stupid question, please feel free to tell me so.
You must change current working directory to the sip-4.15.5 first:
cd C:\Users\User\Desktop\Programming\Sip\sip-4.15.5
python configure.py

Setting up VCAP (cloudfoundry) without a script

I would like to setup VCAP without a script on my linux box (mostly for learning, but also for controlling which packages get installed). I want to do it for a production like system (so it's not my own linux box, but a server that I use for demo purposes)
I am using Ubuntu 10.04 and I have rvm 1.10 installed). I already asked this question on cloudfoundry support (http://support.cloudfoundry.com/entries/21004021-single-node-vcap-setup-without-a-script-chef-etc)
Really apprecaite your input
Looks like your post on the CF forums was updated. As mentioned there, documentation for self-install doesn't exist. Your best bet is to use the existing install scripts, read through what they're doing, and perform the process manually.
The original install script: https://raw.github.com/cloudfoundry/vcap/master/setup/install
The new Chef-based install script, which will replace the original script: https://github.com/cloudfoundry/vcap/blob/master/dev_setup/bin/vcap_dev_setup

Resources