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

ImportError: cannot import name 'Etherscan' from 'etherscan' #32

Open
kubesqrt opened this issue Feb 16, 2022 · 7 comments
Open

ImportError: cannot import name 'Etherscan' from 'etherscan' #32

kubesqrt opened this issue Feb 16, 2022 · 7 comments

Comments

@kubesqrt
Copy link

from etherscan import Etherscan
eth = Etherscan('CU3GAMEJKER5MVUKJ4Z3NVTIK5Y2A75D58')

eth.get_gas_oracle()

Terminal:
ImportError: cannot import name 'Etherscan' from 'etherscan'

I am running python 3.9.7 on windows 10.

@github-actions
Copy link

Thanks for reporting this issue, we are on it :)

@quidverse
Copy link

@kubesqrt this happens because your code is inside a file named etherscan.py. If you rename it, the error will go away

@gowa-coder
Copy link

still not working , what we have to rename?

@merlinmary
Copy link

@Terkey7762 Try:

import etherscan
eth = etherscan.Client('CU3GAMEJKER5MVUKJ4Z3NVTIK5Y2A75D58')

@kieran-mackle
Copy link

@kubesqrt I think this is because you have installed etherscan instead of etherscan-python - as per the installation guide of this repo.

pip uninstall etherscan
pip install etherscan-python

@Robert-ZLF
Copy link

Robert-ZLF commented Jun 4, 2022

You may need to check where actually the etherscan lib installed if you have different python versions install on your computer. For my case somehow the lib installed in my conda envriments, however, I was run install command in another python enviroment. I just found this when I try to uninstall etherscan-python

@EmperorMew
Copy link

from etherscan import Etherscan eth = Etherscan('CU3GAMEJKER5MVUKJ4Z3NVTIK5Y2A75D58')

eth.get_gas_oracle()

Terminal: ImportError: cannot import name 'Etherscan' from 'etherscan'

I am running python 3.9.7 on windows 10.

I encountered this problem yesterday. Incorrectly, I use pip install etherscan rather than pip install etherscan-python. Moreover, if both are placed in the same environment, they will clash.

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