Lesson 4: Web3.py Simple Storage errors #1542
-
Issue 1: What is the issue here?: When i try to import web3, solcx, & dotenv, it gives me an error saying: Import "web3" could not be resolved Import "solcx" could not be resolved Import "dotenv" could not be resolved. I even tried copy pasting the full code to ensure there isn't any error in the code, but i guess there's something else out of the way. I tried what internet suggested me, but so far did not prove to be helpful. So can someone please be kind enough to help me out here? Thank you. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while trying to install package. note: This is an issue with the package mentioned above, not pip. And when i run the program code, the detailed Terminal Output appears as: Code link: https://github.com/PatrickAlphaC/web3_py_simple_storage/blob/main/deploy.py Python version: I had the latest one - version 10 but changed it to version 9 as i heard v10 has some issues with web3 lib. Issue 2: Should i put ...python/script in path (system) variable or node.js location? - When i alter the path in system variable and change it to python, vscode does not recognize node.js, while when i enter node.js as path, VSCode has some issues with python, i reckon, as i remove "...python/script" file from path variable in system environment variables. This is as when i do node --version, the terminal output is: node : The term 'node' is not recognized as the name of a cmdlet, function, script file,
I'm confused, someone please help me resolve these issues. Much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Hello @betheashvin
This is because you are not selecting the correct python interpreter on which you have those packages installed, make sure to select the correct python interpreter on python.
This is because you have some important MSVC libraries needed for python development, for this you would have to install visual studio community and the python libraries of it, this is very heavy so you will need at least 35Gb of free space.
Neither of them, you should add global paths for both Node and Python in order to work anywhere you wanted to work. Recommendation: Windows is just really terrible managing this things, I strongly recommend you to use WSL (Windows Subsystem for Linux) and migrate your workflow there, there is a guide on the course index called "Windows Support" to install WSL and and the tools you'll need. |
Beta Was this translation helpful? Give feedback.
-
You mean using WSL instead of the Windows Terminal and using VSCode as it
is, right? Or something else?
And sorry I'm just confused in this.
Thanks again :)
…On Thu, Jun 16, 2022, 23:44 Vasiliy Gualoto ***@***.***> wrote:
you may have missing some dependencies for development on your windows
machine.
I recommend python 3.8 instead, and again WSL is a better option.
—
Reply to this email directly, view it on GitHub
<#1542 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQOGJB53MVQBUM2NG5CX7FTVPNYZHANCNFSM5Y35SQOA>
.
You are receiving this because you were mentioned.Message ID:
<smartcontractkit/full-blockchain-solidity-course-py/repo-discussions/1542/comments/2966310
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hello @betheashvin And, also based on the compatibility with NPM and web3 Libraries please uninstall the current version and install the LTS one: nvm deactivate
nvm uninstall // you might select the version you want to uninstall
nvm install --lts |
Beta Was this translation helpful? Give feedback.
Hello @betheashvin
This is because you are not selecting the correct python interpreter on which you have those packages installed, make sure to select the correct python interpreter on python.
This is because you have some important MSVC libraries needed for python development, for this you would have to install visual studio community and the python libraries of it, this is very heavy so you will need at least 35Gb of free space.