OSError: getsockaddrarg: bad family in GPYTHON files included into gpython 3L package. Why? - error-handling

In gpython 3L package there are included such examples of codes:
name: test.py
You can find this code inside package as "script 3".
If I try execute this code I obtain error
If I do the same with code Hello_World.py
import androidhelper
droid = androidhelper.Android()
droid.makeToast('Hello, Android!')
print('Hello world!')
I getting the same error. What I do wrong ? Why standard script from gpython 3L package does not works ?
I'm newbie :)
ERROR of first code
error of second code

Related

CPLEX Python API installment on Mac big sur(M1) CpoException problem

I just install Cplex on my mac(m1). When I run any example code, it shows this error.
File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site- packages/docplex/cp/solver/solver_local.py", line 120, in init
raise CpoException("Executable file '{}' does not exists".format(xfile))
CpoException: Executable file 'cpoptimizer' does not exists.
What's the main issue here?
Issue Solved:
Just change this line
msol = mdl.solve(TimeLimit=10) to
msol = mdl.solve(TimeLimit=10, execfile='/Applications/CPLEX_Studio221/cpoptimizer/bin/x86-64_osx/cpoptimizer')

unable to import 'econml' in pandas

I have installed the 'econml' package but when I try to import DML, using :
from econml.dml import DML
I am getting the following error:
'ImportError: cannot import name 'show_config' from 'numpy' (unknown location)'
I am wondering how can I fix this issue.
Two steps:
Find any file named as "numpy.py" in your script directory and change it into another name.
Delete any file named as "numpy.pyc" or any other file generated while compiling your code.

New to Jython Need help extracting data from file

I am new to scripting and programing in general. I am trying to run WebSphere command line tool, wsadmin, and it keeps failing. I am looking for answers for 2 questions about the following code:
**import sys
import os
import re
execfile('wsadminlib.py')
appName = sys.argv[1]
configLocation = "/location/of/config/"
config_prop = open(configLocation + appName+"-Config.csv", "r")
for line in config_prop:
line = line.split(",")
print line**
I launch run the scripts in as wsadmin and from the command line is as follows:
>>>>./wsadmin.sh -lang jython -f deploy.sh param1
Questions:
The problem is that it fails on the "for line in config_prop" with AttributeError: getitem?
when I run this through python on the same machine, the code works. Just not when I run it through wsadmin tool?
Is there other ways to extract data from txt or csv with comma delimited and setting a variable for each word that is only one line long.
Issue has been resolved. the libraries used is 2.1 and the syntax i was using was post 2.2.

eclipse-neon bower-install can't run due to error in the file

I create javascript project and bower.json. After adding dependencies as follow gives me red-cross on project->bower_components->bootstrap->grunt->change-version.js file and query->src file:
"dependencies":{
"bootstrap":"~3.3.7"
}
This is first problem:
Description Resource Path Location Type
Expected name at 2:1 .eslintrc.json /gruntTest/bower_components/jquery/src line 2 JSON Problem
Second problem:
Description Resource Path Location Type
Unexpected token ILLEGAL change-version.js /gruntTest/bower_components/bootstrap/grunt line 1 JavaScript Problem
I assumed that eclipse neon doesn't need to download Nodeclipse & Enide and try to practice from scratch thats the reason error happened.
Nodeclipse & Enide must installed before practicing nodejs in eclipse.
I followed this link and worked great.
http://www.nodeclipse.org

ImportError: No module named texttable (igraph, py2exe,cx freeze/gui2exe)

I've spent 2 days trying to solve this problem and I'm getting nowhere.
I try to get an executable from my python script.
Script is running with no issues. I build graphs in it by using igraph which is my favorite choice for this task.
After compiling my script I get the results as expected (Dist folder with my exe and its stuff in it)
When I try to run the exe I get this annoying error message:
File "igraph\__init__.pyc", line 36, in <module>
File "igraph\clustering.pyc", line 38, in <module>
File "igraph\summary.pyc", line 36, in <module>
File "igraph\vendor\__init__.pyc", line 33, in vendor_import
ImportError: No module named texttable
I checked many threads related to ImportError. I went in the folder containing texttable and IT'S THERE! It's not missing! I've tryed something with changing the path but still no succes.
at the beginning of my script I have:
import re
import os
import csv
import math
from igraph import *
import thread
import unicodedata
from time import sleep
import wx.grid as gridlib
import sys
import Tkinter
from Tkinter import *
I have tryed from igraph import Graph but it would still look for that TEXTTABLE.
I've tried using py2exe, cx freeze and also the nice Gui interface to them GUI2exe. No luck. Same Error whatever I try.
I'm sorry if the solution is obvious. I'm not a pro. Any help is much appreciated!
igraph is importing texttable dynamically, so the freezing tools don't know that they need to copy the module in.
In cx_Freeze, you could add igraph.vendor to 'packages' (see the docs) to force it to copy everything from that package. There's probably a similar option for py2exe.
Alternatively, if you put import igraph.vendor.texttable somewhere in the code, the freezing tools will pick that up and know to include it.