ModuleNotFoundError: No module named 'kivymd_extensions.sweetalert' - python-3.x

I am attempting to create an apk with Kivymd using googlecolab. I am following the official instructions from Kivymd. But my apk was crashed.This is my logcat Error ModuleNotFoundError: No module named 'kivymd_extensions.sweetalert' .
requirements = python3,kivy==2.0.0,https://github.com/kivymd/KivyMD/archive/master.zip,pygments,sdl2_ttf==2.0.15,pillow,openssl,sqlite3,kivymd_extensions.sweetalert

There are some modules which are not easy to install in the buildozer file.
in my experience as i have use sweetalert in a project and it worked, i needed to change some variables of the kivymd_extensions widgets so included the entire kivymd_extensions folder in my project folder hence i didn't have to include in my buildozer file cuz my project ran with the version in the project folder. the kivymd_extensions folder you are adding to your project folder make sure it has the sweetalert folder in it
and the following code to import
from kivymd_extensions.sweetalert import SweetAlert

Related

How can I include the parent folder structure on a library distribution in Python 3.6 using setuptools?

I am using setuptools to distribute a Python library. I have the following directory structure:
/src
/production
setup.py
/prod-library
/package1
/package2
The folder structure has to stay like this because there will be multiple libraries living under src in the future and need to have their own setup.py files. So the traditional answer of having 1 parent folder and moving out setup.py to the root folder will not work in this case.
I am using the following in the setup.py of the library to export the library (which is working)
package_dir={'': '.'},
packages=find_packages()
Inside the project tar.gz it looks like this:
/prod-library
/package1
/package2
But inside the prod-library package Python files, imports referencing other modules need to be structured as follows:
import src.production.prod-library.package1
import src.production.prod-library.package2
The problem:
After importing one of those libraries to a different project, errors are raised as follows:
ModuleNotFoundError: No module named 'src.production'
Since the build only drops in the /prod-library package, the project importing the code fails due to the missing folder structure (src/production) since the built distribution only has /prod-library.
What I need to do is include the src/production folder in the distribution build so the resulting tar.gz file looks like this:
/src
/production
/prod-library
/package1
/package2
I am not sure how I can get those in the build structure since they are above the setup.py location. How can that be accomplished?
If it can’t, then I am open to suggestions about fixing the imports if that can be a solution.
I found the solution to the problem. It has to do with how the package_dir was configured:
package_dir={'': '.'}
Although the above package_dir built the files and included all subfolders as expected, the egg-info file's SOURCES.txt was incorrect and showing as follows:
./prod-library/__init__.py
./prod-library/package1/__init__.py
etc...
When the package was imported into another API, the imports could not be found when attempting import prod-libary.package1.file.py
After changing the package_dir as follows, I was able to use the library normally:
package_dir={'.': ''}
The above effectively removed the ./ prefix in the SOURCES.txt file which was breaking the imports. Now the egg-info's SOURCES.txt looks correct:
prod-library/__init__.py
prod-library/package1/__init__.py
etc...

Node: Import Typescript library with npm/yarn

I have a Node-Typescript project. That project has a dependency on another Typescript project. The dependency points directly to my Bitbucket repository. When I run "yarn install" the whole repository is cloned into my node_modules. That's perfect. In the root directory of my library-project is a index.ts file which contains the line "export * from './source'" to make it all available. I import and use some classes from the library in my code.
When I compile the project I get the exception: "Cannot find module './source'.". Furthermore it is not possible to automatically import the classes in Intellij.
What am I doing wrong?
Note:
I know, that the "right" way for libraries would be to generate JS and typing files and put the compiled source in to a private NPM repository. Since I am the only one that uses that library, I would like to have a simpler approach and just import the uncompiled Typescript into my project.

python pyrobot module giving error

I installed the pyrobot module through pip, but is still getting this error. This is in anaconda.
How do I solve it?
I have noticed this problem as well.
When you have a look inside your site-packages/pyrobot you will notice the forms folder is missing, however, when you have a look at the original github repo you can see this folder.
You can try manually copying the forms folder into site-packages/pyrobot. Please be aware when you manually copy the folder, pip uninstall pyrobot will not delete what you copied. So you have to manually delete as well.
Im not sure. Should not it be from pyrobot import RoboBrowser instead of from pyrobot import Robot?
Answer updated:
lol, It is confusing because
https://github.com/jmcarp/pyrobot and https://github.com/chriskiehl/pyrobot have same name but are different library.
pip install pyrobot installs https://github.com/jmcarp/pyrobot but if Im not mistaken what you want is this https://github.com/chriskiehl/pyrobot.
If so, you can just directly copy one file pyrobot.py from https://github.com/chriskiehl/pyrobot into your project source directory and use it.
Unfortunately I can not test it because it is a windows only library.

JSPM not creating js file in root directory

Overview
I'm trying to install the bootstrap-wysiwyg package in my ES6 project using JSPM.
Usually you can just install a package using the command
jspm install npm:bootstrap-wysiwyg
And JSPM will take care of the config.js file and create the entry JS file in the jspm_packages folder.
My problem
For this particular package, it does create the config.js entry to the bootstrap-wysiwyg JS file in the root directory, but it does not create that JS file itself.
Files
Config.js
"bootstrap-wysiwyg": "npm:bootstrap-wysiwyg#1.0.4",
Import
import stuff from 'bootstrap-wysiwyg';
Error message
GET http://localhost:9000/jspm_packages/npm/bootstrap-wysiwyg#1.0.4.js 404 (Not Found)
Question
How can I make sure JSPM creates that file? I could make one myself, but then version control is obviously broken.
The module your are trying to import is missing "main" entry in its package.json: https://github.com/steveathon/bootstrap-wysiwyg/blob/master/package.json Therefore, JSPM cannot create the main import. You have to either import files directly from the module (i.e. import stuff from 'bootstrap-wysiwyg/js/smth') or create an override for this package which will define "main" for the package (https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm#testing-configuration).

Importing existing puppet projects into Geppetto?

I was working on Puppet modules and most of the edits were via 'vim' commands. I read about Geppetto that seemed very promising, so I downloaded and installed it. I was able to create new Puppet project, but it seems that I can not import already existing one?
A 'project' within the scope of geppetto has a hidden xml file called '.project' inside the directory.
If your directory contains the .project file, then you can import the project as 'Existing project into workspace'
If the directory does not contain this file then you need to import the project as a 'file system'. Geppetto will then create the xml file for you.
This is true as of version 4.x

Resources