qpython with sl4a library - sl4a

I've been googling around and found people showing scripts importing sl4a instead of androidhelper. When I try to do it I receive 'no module named sl4a'. Does it run only in Qpython3? I have sl4a for arm in qpython's site-packages folder. Tks.

In qpython2, sl4a module is package inside androidhelper. In fact, sl4a module will get imported inside androidhelper
You can do either below to import sl4a alone in qpython2
from androidhelper import sl4a
# OR
import androidhelper.sl4a as sl4a
# OR
import androidhelper # then access sl4a with androidhelper.sl4a
In qpython3, both sl4a and androidhelper module is within the sys.path so you can just import any of them

Related

lib folder is not present inside the '#module-federation/nextjs-mf?

Hi i am trying to make use of micro front end in nextjs , So as mentioned in this npm pkg link ,
lib folder is not present inside the #module-federation package
tried below way to import the include-defaults
import '#module-federation/nextjs-mf/lib/include-defaults'
but it throws the below error
Module not found: Can't resolve '#module-federation/nextjs-mf/lib/include-defaults'
import App, { AppContext as NextAppContext } from 'next/app'
import '#module-federation/nextjs-mf/lib/include-defaults'
We can find files inside the src folder, So we can point src like below
import '#module-federation/nextjs-mf/src/include-defaults'
This will importing lib as expected ,
** Note but i am not sure , why the lib folder and its files are not there in the package

Not able to import package in Next js

I installed the Jodit Editor using npm -i jodit-react. The package is added in the node modules but I am unable to import it.
This is is how I am importing the package import JoditEditor from "../../node_modules/jodit-react/index";
And this is the error I am getting: Module not found: Can't resolve '../../node_modules/jodit-react/index'
Screenshot of the error:
Change this line:
import JoditEditor from "../../node_modules/jodit-react/index";
To:
import JoditEditor from 'jodit-react';
You can take a look at this live working example with Next.js

Unable to import a local js file in react js

Below code works — trying to import jquery file from node modules
Import $ from ‘jquery’;
Below code doesn’t work— I am trying to import the same jquery file from ‘clientapp/src/kendo’ folder
Import $ from ‘../kendo/jquery’;
Can you please suggest how to fix. Actually I have few licensed js library files, it errors when I try to import them from ‘clientapp/src/kendo’ folder.
You can use resolve.alias in webpack to import the modules from a directory that has more levels up in the filesystem.
https://webpack.js.org/configuration/resolve/#resolvealias
As a good practise, you should not import files from node_modules, those are compiled in webpack, so you use the import import $ from 'jquery'

How to solve the issue ,from scrapy_djangoitem import DjangoItem ImportError: No module named scrapy_djangoitem

Found an error in my programm ,I had installed the pip install scrapy-djangoitem and also import the from scrapy_djangoitem import DjangoItem,then issue is found like from scrapy_djangoitem import DjangoItem ImportError: No module named scrapy_djangoitem
from scrapy_djangoitem import DjangoItem
from duklrapp.models import Newsdetails
class NewscrawlItem(DjangoItem):
django_model = Newsdetails
You must install scrapy-djangoitem first:
pip install scrapy-djangoitem

Importing packages errors

Error in importing "from watson_developer_cloud import ToneAnalyzerV3", and "ibm_watson" in Visual Studio Code.
Python using VS code to run the Tone Analyzer in IBM Watson cloud. I tried the existing code, however some errors occur while compiling the code, as import packaging error happen. Even the tensorflow already updated and the specific packages already installed.
The bold fonts are the errors.
from __future__ import print_function
import json
from os.path import join, dirname
**from ibm_watson import ToneAnalyzerV3
from ibm_watson.tone_analyzer_v3 import ToneInput**
import operator
import twitter
import os
import json
**from watson_developer_cloud import ToneAnalyzerV3**
from _codecs import encode
I expect there is no wrong once compiled.

Resources