Why am I unable to import #rainbow-me/rainbowkit/styles.css? - css

I am trying to integrate rainbowkit and wagmi into an existing website that currently uses web3. It works when I comment out the styles import but it just looks really ugly. I have made sure npm is latest version and so are rainbowkit and wagmi.
My import statement:
import '#rainbow-me/rainbowkit/styles.css'
result:
Failed to compile.
./src/App.tsx
Module not found: Can't resolve '#rainbow-me/rainbowkit/styles.css' in '/home/apollo/manifest-github/physical-claim-frontend/src'

I was having this issue as well.
I replaced the import with
import '#rainbow-me/rainbowkit/dist/index.css';
which is the non aliased path
seems to be compiling fine now!

I fixed it by replacing import '#rainbow-me/rainbowkit/styles.css' to import '#rainbow-me/rainbowkit/dist/index.css';

Related

How to import numjs (or any generic js library) in a vue 3 project?

Consider you do npm i numjs then you want to do something like
import * as nj from 'numjs'
but it does not quite work like other libraries. Is this the correct import statement or is there some trick?

Fast Ai: AttributeError: 'Learner' object has no attribute 'fine_tune'

Fast Ai uses a very unconventional style of from fastai import * etc.
I for one do not like it so was painstakingly identifying each import in the chapter 2 of the fastai book but ran into the error
AttributeError: 'Learner' object has no attribute 'fine_tune'
However, when I then go and do
from fastbook import *
it works. This is a very odd behavior in that something is done to the cnn_learner class or the module that contains it making it have the fine_tune method if the above import is done.
I would like to avoid this style of coding, so what should I do to load the correct version of Learner?
I just faced the exact same issue. After looking at one of their tutorial I saw that the cnn learner is not imported from the expected package.
from fastai.vision.all import cnn_learner
# rather than
from fastai.vision.learner import cnn_learner
calling the fine_tune method then works as expected !
Fastai does a lot of monkey patching. Not only to its own imports but also to other libraries such as pathlib or torch. I personally don't like this style of coding either but it is what it is.
I would highly recommend creating a separate environment (e.g. through conda), install fastai there and use their from ... import *. I have tried to work around these imports in the past but since you don't know (unless you dig into source) where/what has been monkey patched, you will be running into missing attribute and similar errors all over the place.
Also, it doesn't play nice with some other libraries. I remember having hard time making it work with opencv due to package dependencies, where installing opencv broke some of the fastai's functionality (which I have only found later) due to overriding something that has been patched by fastai in some external library.

how can i add javafx.util.Pair to project compiled with jdk11.0.2?

Can not change the JDK, tried downloading javafx.jar and it did not work either. what should I do?
You can replace javafx.util.Pair (using import javafx.util.Pair) by AbstractMap.SimpleEntry (using import java.util.AbstractMap) if it is the only class from javafx

Import missing module

What is the convention for properly importing a module in Airflow?
I would like to import this operator:
https://github.com/apache/airflow/blob/master/airflow/contrib/operators/mlengine_operator.py
using this line:
from airflow.contrib.operators import MLEngineTrainingOperator
I get the following error: `
cannot import name MLEngineTrainingOperator
`
This solved the issue.
from airflow.contrib.operators.mlengine_operator import MLEngineTrainingOperator

Sikuli - NameError: global name 'openApp' is not defined

I'm calling a sikuli function, inside Sikuli IDE, but I get this error "NameError: global name 'openApp' is not defined"...
If I try to do openApp('calc') in a new Sikuli blank file, it works, but if I use in another .sikuli file like:
def sample():
import myLib
# my Lib is .py file that I've created and put it on sikuli-script.jar
var = somevalue
myLib.myFunction(something)
openApp('calc')
I get the error with "openApp" and other sikuli funcions like "Key" (ex: Key.ENTER) too...
Hope I had explained that well
By default, Sikuli will insert a from sikuli import * into all main files. This error tends to occur when you import sikuli modules. If you are importing modules, you will need to add the import manually. See the documentation for more advice.
If your tests are in the same folder basically you can do,
import testName
reload(testName)
from testName import *
This will import your test and execute it's content.
testName should be name of the file without .sikuli extension
I ran into a similar problem was solved by putting from sikuli import * at the first line of any file you are importing. I hope this helps!
I only mentioned this, because with the imported files, I had the greatest overall success with this one, and it became habit to make this the first line.

Resources