python pyrobot module giving error - python-3.x

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.

Related

ModuleNotFoundError: No module named 'kivymd_extensions.sweetalert'

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

When I delete a folder or a file in Django manually and try to run the project I'm getting error on the same module which I have deleted?

I have deleted a folder named accounts from my Django project and tried to run the file, but getting this error
"ModuleNotFoundError: No module named 'accounts'"
Even though I have deleted manually, it's asking me to delete the paths as well. How to get over from this error?
How DjangoStarter said, check your installed apps and the imports in other apps.

node or npm: How to see the source code of a package installed

Like in python i install a package using
pip install django
inside a virtualenv,
Then it puts all the files in site-packages folder. and then i can import the package using
from django.core import mail
But i can easily browse the code of django/core in site-packages
Similarly if I install a package using npm can i see the source of that
Eg:
import React, { useEffect } from "react";
Now i want to see the react file and go through the React and useEffect
Is it possible
I do not have background in Python. So, can't explain or compare in Python way. But, yes! You can read or go through the source code in most of the cases.
Now, talking about the specific example you mentioned in question - React. Things are little complicated as we're talking about one of the popular library. You may wouldn't find React.js or react.js file directly. But, that doesn't mean you can read the source code. Let's do it.
Create an application that has react as dependency (You can create an application using create-react-app).
In this application, you'll have node_modules folder. Within this node_modules, you'll have folder after the name of dependency e.g. react. Go inside this folder.
You'll find the package.json file. Open it and look for main. The main is an entry point of the program/package. It mentioned index.js. So, let's open the index.js file.
If you open the index.js, you'll see that based on environment, they're requiring the react.production.min.js or react.development.js file. Open this react.development.js file from cjs folder.
In this file, do a search for useEffect. You will find a function with the same name.
But, I wouldn't recommended you to read the code in this way, if you're planning for React. You may try this solution. Also, if you're planning to read the source code as starting point, why not start with simple and easy to read packages? And don't forget that if not all then most of the packages are there on GitHub and on NPM website, you'll see the link for the Repository.

Angular 2, import custom package

I'm using angular 2+, I have copy a custom package into my node_module directory like this node_module/#customPackage/forms
so in my component code I import it like this import {blabla}from '#customPackage/forms'.
but at the compilation time I still have an error saying "[ts] cannot find module #customPackage/forms".
I really don't know why I have that error. Please help.
Thanks
Hi no you dont need to copy paste your package, The correct way to use your custom package into the angular application, is to link it like so:
STEPS:
1. inside your custom package folder:
yarn build
yarn link :
this will display something like this(this is from my custom package) .
see the yarn link "my-package":
Now, go into your angular project folder and type the above sentence, to link your custom package into your angular project:
yarn link "my-package" (we need the double quotes around the package name)
open your code editor, if you use vscode you should see the package into node_modules folder, with a small arrow on the right like so:
If you succeed on the above, you can now use your module like e.g import { mymodule } from 'my-package
Hope this helps.
you can write down package name in dependencies array in package.json file and after hit npm install.so install all dependencies

node modules of modules install in unwanted spot

Hello and thanks for reading,
Historically, when I ran the command:
npm install module
Module would install in the node_modules dir of the current working directory. This still happens, however, the modules that the module use, is now installing alongside the original module, so that my node_modules dir might look like:
./node_modules/module/
./node_modules/module-of-that-module/
When it used to look like:
./node_modules/module/node_modules/module-of-that-module/
I suppose it might boil down to preference, but I don't really like the sub-modules installing alongside the main module I was trying to install, as my main node_modules directory became cluttered with hundreds of random modules fast. Also it seems kind of strange for the structure to be this way if the modules of modules need different versions.
Can anyone please explain what changed here? And how I might change it back? I tried to find a solution prior to writing this, but it's unclear to me how to search around this issue or what category it falls under.

Resources