Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web3 issue #3

Closed
ahmadsmadi990 opened this issue Jul 7, 2021 · 19 comments
Closed

web3 issue #3

ahmadsmadi990 opened this issue Jul 7, 2021 · 19 comments

Comments

@ahmadsmadi990
Copy link

i keep getting BSCTokenSniper-main\BSCTokenSniper.py", line 3, in
from web3 import web3
ModuleNotFoundError: No module named 'web3'

@MazWolz
Copy link

MazWolz commented Jul 8, 2021

Having same issue. Installing the web3 module as directed doesn't seem to work.

I tried adding the node_modules folder to the pathway by creating a settings.json in the vscode folder as directed here. Still didn't work.

Also tried upgrading Python and installing web3.py instead of web3.js using $ pip install web3. The program was able to find the module however this was the log:

[Info] Web3 successfully connected
Traceback (most recent call last):
File "c:\xxx\BSCTokenSniper\BSCTokenSniper.py", line 105, in
updateTitle()
File "c:\xxx\BSCTokenSniper\BSCTokenSniper.py", line 101, in updateTitle
walletBalance = web3.fromWei(web3.eth.get_balance(walletAddress),'ether') #There are references to ether in the code but it's set to BNB, its just how Web3
was originally designed
File "C:\Python39\lib\site-packages\web3\module.py", line 53, in caller
(method_str, params), response_formatters = method.process_params(module, *args, **kwargs) # noqa: E501
File "C:\Python39\lib\site-packages\web3\method.py", line 194, in process_params
_apply_request_formatters(params, self.request_formatters(method)))
File "C:\Python39\lib\site-packages\eth_utils\functional.py", line 45, in inner
return callback(fn(*args, **kwargs))
File "C:\Python39\lib\site-packages\web3\method.py", line 50, in _apply_request_formatters
formatted_params = pipe(params, request_formatters)
File "cytoolz/functoolz.pyx", line 667, in cytoolz.functoolz.pipe
return c_pipe(data, funcs)
File "cytoolz/functoolz.pyx", line 642, in cytoolz.functoolz.c_pipe
data = func(data)
File "cytoolz/functoolz.pyx", line 505, in cytoolz.functoolz.Compose.call
ret = func(ret)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.call
return self.func(*args, **kwargs)
File "C:\Python39\lib\site-packages\web3_utils\abi.py", line 799, in map_abi_data
return pipe(data, *pipeline)
File "cytoolz/functoolz.pyx", line 667, in cytoolz.functoolz.pipe
return c_pipe(data, funcs)
File "cytoolz/functoolz.pyx", line 642, in cytoolz.functoolz.c_pipe
data = func(data)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.call
return self.func(*args, **kwargs)
File "C:\Python39\lib\site-packages\web3_utils\abi.py", line 833, in data_tree_map
return recursive_map(map_to_typed_data, data_tree)
File "C:\Python39\lib\site-packages\web3_utils\decorators.py", line 30, in wrapped
wrapped_val = to_wrap(*args)
File "C:\Python39\lib\site-packages\web3_utils\formatters.py", line 89, in recursive_map
items_mapped = map_collection(recurse, data)
File "C:\Python39\lib\site-packages\web3_utils\formatters.py", line 76, in map_collection
return datatype(map(func, collection))
File "C:\Python39\lib\site-packages\web3_utils\formatters.py", line 88, in recurse
return recursive_map(func, item)
File "C:\Python39\lib\site-packages\web3_utils\decorators.py", line 30, in wrapped
wrapped_val = to_wrap(*args)
File "C:\Python39\lib\site-packages\web3_utils\formatters.py", line 90, in recursive_map
return func(items_mapped)
File "C:\Python39\lib\site-packages\web3_utils\abi.py", line 830, in map_to_typed_data
return ABITypedData(func(*elements))
File "C:\Python39\lib\site-packages\web3_utils\normalizers.py", line 78, in wrapper
modified = to_wrap(type_str, data)
File "C:\Python39\lib\site-packages\web3_utils\normalizers.py", line 196, in abi_address_to_hex
validate_address(data)
File "C:\Python39\lib\site-packages\web3_utils\validation.py", line 169, in validate_address
raise InvalidAddress(f"ENS name: '{value}' is invalid.")
web3.exceptions.InvalidAddress: ENS name: 'xxx' is invalid.

Is there away around this?

@kelvionald
Copy link

Install web3 from under venv (pip install web3)

@dsobe369
Copy link

C:\Users\dsobe>npm install Web3
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/Web3 failed, reason: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dsobe\AppData\Roaming\npm-cache_logs\2021-07-30T02_10_35_851Z-debug.log

This the error when I tried installing Web3

@ntfargo
Copy link

ntfargo commented Jul 31, 2021

pip install web3 or pip install --upgrade web3

@dsobe369
Copy link

dsobe369 commented Aug 1, 2021

pip install web3 or pip install --upgrade web3

'pip' is not recognized as an internal or external command,
operable program or batch file.

@ntfargo
Copy link

ntfargo commented Aug 1, 2021

pip install web3 or pip install --upgrade web3

'pip' is not recognized as an internal or external command,
operable program or batch file.

You need to add the path of your pip installation to your PATH system variable.
Open CMD with administrator.
and run this
setx PATH "%PATH%;C:\Python39\Scripts"

@dsobe369
Copy link

dsobe369 commented Aug 1, 2021 via email

@dsobe369
Copy link

dsobe369 commented Aug 1, 2021 via email

@BytePhoenixCoding
Copy link
Owner

I have just installed python on my laptop (windows 8) and got it successfully to work. I installed python 3.9.6 and installed web3 using 'npm install web3' but that didn't work.

Fix that worked for me:
Try 'py -m pip install web3' or replace 'py' with python if you have a python older version.

Worked right away after that. Let me know if that works.

@dsobe369
Copy link

dsobe369 commented Aug 2, 2021 via email

@dsobe369
Copy link

dsobe369 commented Aug 2, 2021 via email

@dsobe369
Copy link

dsobe369 commented Aug 2, 2021 via email

@dsobe369
Copy link

dsobe369 commented Aug 2, 2021 via email

@BytePhoenixCoding
Copy link
Owner

When I installed python I originally installed it in appdata path. I uninstalled and reinstalled it to C:/Python39 and suggest you do the same, made things easier for me.

Then try to run the script again, open cmd prompt this time and cd to directory where bsctokensniper.py is installed, and type 'python bsctokensniper.py' and enter, you should be able to read the error message that comes up (if any). Paste the error message contents after running it so I can see whats happening.

@dsobe369
Copy link

dsobe369 commented Aug 3, 2021 via email

@dsobe369
Copy link

dsobe369 commented Aug 3, 2021 via email

@crypto-MMXXII
Copy link

it's now working, I will let you know if ever got an issue. Thank you very much.

On Tue, Aug 3, 2021 at 7:16 PM bry razo @.> wrote: Done uninstalling Python39 and have installed under c:\Python39 folder. After restarting pc, I tried running the script on given instruction but I got an error as follows; 'Python' is not recognized as an internal or external command, operable program or batch file. I've tried typing 'py bsctokensniper.py' and got an error message too, 'Loading... Traceback (most recent call last); File "C:\BSCTokenSniper\bsctokensniper.py", line 3, in from web3 import Web3 ModuleNotFoundError: No module name 'web3' Thanks. On Tue, Aug 3, 2021 at 7:02 AM BytePhoenixData @.> wrote: > When I installed python I originally installed it in appdata path. I > uninstalled and reinstalled it to C:/Python39 and suggest you do the same, > made things easier for me. > > Then try to run the script again, open cmd prompt this time and cd to > directory where bsctokensniper.py is installed, and type 'python > bsctokensniper.py' and enter, you should be able to read the error message > that comes up (if any). Paste the error message contents after running it > so I can see whats happening. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#3 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AU4SOIRG7PXB4YARU3PA5UDT24PYXANCNFSM477BQEPQ > . > Triage notifications on the go with GitHub Mobile for iOS > https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 > or Android > https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email > . >

@ dsobe369 so how did you solve the issue. Thanks in advance

@dsobe369
Copy link

dsobe369 commented Aug 18, 2021 via email

@crypto-MMXXII
Copy link

I just reinstall 'py -m pip install web3' and restart computer then its working fine. On Wed, Aug 18, 2021 at 2:15 AM BSC-Contarcts @.*> wrote:

it's now working, I will let you know if ever got an issue. Thank you very much. … <#m_4509628366066014142_> On Tue, Aug 3, 2021 at 7:16 PM bry razo @.
> wrote: Done uninstalling Python39 and have installed under c:\Python39 folder. After restarting pc, I tried running the script on given instruction but I got an error as follows; 'Python' is not recognized as an internal or external command, operable program or batch file. I've tried typing 'py bsctokensniper.py' and got an error message too, 'Loading... Traceback (most recent call last); File "C:\BSCTokenSniper\bsctokensniper.py", line 3, in from web3 import Web3 ModuleNotFoundError: No module name 'web3' Thanks. On Tue, Aug 3, 2021 at 7:02 AM BytePhoenixData @.
> wrote: > When I installed python I originally installed it in appdata path. I > uninstalled and reinstalled it to C:/Python39 and suggest you do the same, > made things easier for me. > > Then try to run the script again, open cmd prompt this time and cd to > directory where bsctokensniper.py is installed, and type 'python > bsctokensniper.py' and enter, you should be able to read the error message > that comes up (if any). Paste the error message contents after running it > so I can see whats happening. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#3 (comment) <#3 (comment)>>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AU4SOIRG7PXB4YARU3PA5UDT24PYXANCNFSM477BQEPQ > . > Triage notifications on the go with GitHub Mobile for iOS > https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 > or Android > https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email > . > @ dsobe369 so how did you solve the issue. Thanks in advance — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU4SOITA4VMPJSFEJPE6YA3T5KRKRANCNFSM477BQEPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Thanks as soon as i installed the correct visual C++ and reinstalled the pip intsall web3 it worked liuke a charm. the only issue now are the not showing colors described in py file. thanks mate

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants