I am trying to import a library in Remix using:
import "github.com/Arachnid/solidity-stringutils/strings.sol";
However, I get a compilation error that says
Unable to import "undefined": Not Found.
Any idea what wrong could I be doing here?
Your link is broken. This is the correct link: github.com/arachnid/solidity-stringutils/src/strings.sol
You forgot /src part.
Related
I have successfully installed openzeppelin/contracts, but I am unable to import it. It shows me an error which is
Source "#openzeppelin/contracts/access/Ownable.sol" not found: File import callback not supported
Does anyone have any idea? Thanks
Please Check the #openzeppelin/contracts is installed in Correct Directory..
Also What npm version of #openzeppelin/contracts you have installed ? The positon of OpenZepplin Contracts is changed after version 4..
Refer..
https://forum.openzeppelin.com/t/openzeppelin-contracts-ownership-ownable-sol-not-found/16229/3
https://forum.openzeppelin.com/t/error-importing-openzeppelin-contracts-in-vscode/6971/11
I am trying to run the following code to train paddleOCR.
import paddle
import paddle.distributed as dist
But I'm getting this error:
ModuleNotFoundError: No module named 'paddle.distributed'
Even after I have installed paddle-client.
docker pull paddlepaddle/paddle:2.3.0-gpu-cuda11.2-cudnn8
I use this images which can work well.
You can try the paddlepaddle with 2.3.1 version,and quick install can refer to: https://www.paddlepaddle.org.cn/en
I have a project using JSON APIs was working fine suddenly error occurs while i was debugging my application and want to modify but when i restarted the app it suddenly shows the following error. The required import 'dart:html'; is already in that file. but don't know why this happens. I tried to import dart.io but same issue. i tried to to restart and invilidate caches but the problem exist.
Error:
Launching lib\main.dart on Infinix X652 in debug mode...
Running Gradle task 'assembleDebug'...
Invalid depfile: E:\Flutter Projects\criclite\.dart_tool\flutter_build\d908c0f5b30e137aa06d363a041f44ee\kernel_snapshot.d
Invalid depfile: E:\Flutter Projects\criclite\.dart_tool\flutter_build\d908c0f5b30e137aa06d363a041f44ee\kernel_snapshot.d
lib/ui/News.dart:6:8: Error: Not found: 'dart:html'
import 'dart:html';
Note: project was working fine this issue suddenly comes out without any changes made.
Please remove import dart:html
then flutter clean
and run will resolve issue.
I'm trying to test a smart contract which import 0x in brownie ecosystem. I have the following error when importing from explorer or from abi, also it looks like solc doesn't take in count the dependency I've install on my computer
CompilerError: solc returned the following errors:
/home/merklejerk/code/0x-protocol/contracts/zero-ex/contracts/src/external/IFlashWallet.sol:23:1: ParserError: Source "#0x/contracts-utils/contracts/src/v06/interfaces/IOwnableV06.sol" not found: File outside of allowed directories.
import "#0x/contracts-utils/contracts/src/v06/interfaces/IOwnableV06.sol";
^------------------------------------------------------------------------
Probably the compiler does not solve the relative path in the correct way.
Maybe the path of the file you import is wrong or not built properly from the compiler: when importing the file IOwnableV06.sol try to remove the # symbol and replace it with ./ or ../ depending on your project folder structure. For example import "../../0x/the-path-here/File.sol";
Or the file you want to import might not be in the allowed paths:
https://docs.soliditylang.org/en/v0.8.7/using-the-compiler.html#how-it-works
(search for --allow-paths).
So, I'm trying to compile in truffle some open zeppelin ERC20 contracts, but I get the following error:
Error: Error: Could not find
import from any sources; imported from C:/Users/Angel/Documents/blockchain course/ethereum game/solidity/contracts/GameToken.sol
at Object.compile (C:\Users\Angel\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\legacy\index.js:72:1)
Token file:
Migration file:
Any ideas? Thanks!
Regarding the documentation, the correct imports are
import "#openzeppelin/contracts/token/ERC721/ERC721Full.sol";
import "#openzeppelin/contracts/token/ERC721/ERC721Mintable.sol";
For those interested, asked the question on the openzeppelin forums and found a solution:
https://forum.openzeppelin.com/t/could-not-find-import-from-any-sources-error/2656/5