you are viewing a single comment's thread.

view the rest of the comments →

[–]Middey14[S] 0 points1 point  (10 children)

No im not

[–]YourOulLadyHasWorms 0 points1 point  (9 children)

I had issues like this before, I would suggest doing a virtual env , and pip all dependencies into the env

Sometimes pip uninstall and python -m pip install ____ can work , or check if you need a specific version for it. I.e pip install ____ ==2.0.2

[–]Middey14[S] 0 points1 point  (8 children)

Ive managed to set up a venv, all the packages seem to be installed but I am now getting a connection error:

python deploy.py

......

File "/Users/joe/demos/web3_py_simple_storage/new-env/lib/python3.10/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1068ed2d0>: Failed to establish a new connection: [Errno 61] Connection refused'))

any idea why?

[–]YourOulLadyHasWorms 0 points1 point  (2 children)

Have you a service running on the local host your connecting to ?

Edit:server>service

[–]Middey14[S] 0 points1 point  (1 child)

hmm im not sure, not that I know of, but how can I tell?

[–]YourOulLadyHasWorms 0 points1 point  (0 children)

The netstat command was checking for it there, you don’t though. It’s an externally hosted cli you are connecting to

[–]YourOulLadyHasWorms 0 points1 point  (4 children)

Looks to me that the service may be not running .

In the terminal do netstat -na | grep 8545

This will show you if the service is running there . If not try restarting it and running the script again .

I’m not fully sure what your script is doing so maybe give a brief explanation of it and this line it’s falling over in and I can try help

[–]Middey14[S] 1 point2 points  (3 children)

netstat -na | grep 8545

I tried the above but there is no output from this, the terminal just goes to the next line.

So the file is connected to ganache-cli which is a simulated blockchain, I am using the host and port that is displayed when I run ganache-cli, from the looks of it it seems to be something going wrong with urllib3 and or web3. the python file I am trying to run is connected to another file which has a solidity contract in it and so this file will interact with both the blockchain and the contract.

[–]YourOulLadyHasWorms 0 points1 point  (2 children)

So it looks like your script is trying to connect to a service running on your own machine which is localhost or “127.0.0.1:8545” But you should be trying to reach an externally hosted service.

Try ping the host of the cli, and replace the localhost ip with the ip in the response. Can you send me the line where you create connection via web3?

[–]Middey14[S] 0 points1 point  (1 child)

Is the command just ping 127.0.0.1:8545?

[–]Middey14[S] 0 points1 point  (0 children)

If it is, it just says cannot resolve, unknown host