ipfs-shipyard / py-ipfs-http-client

A python client library for the IPFS API
MIT License
685 stars 200 forks source link

Unsupported daemon version '0.12.2' (not in range: 0.4.3 \u2264 � < 0.5.0) #313

Open jay0x5 opened 2 years ago

jay0x5 commented 2 years ago

Hi i am new to IPFS and Python and while trying out to store data on ipfs i ran into some errors, please help me

here is my code:

import ipfshttpclient
client = ipfshttpclient.connect('/ip4/127.0.0.1/tcp/8080)  # Connects to: /dns/localhost/tcp/5001/http
res = client.add('test.txt')

Here is the error: ipfshttpclient.exceptions.VersionMismatch: Unsupported daemon version '0.8.0' (not in range: 0.4.18 \u2264 � < 0.5.0)

go-ipfs version: 0.12.2 Repo version: 12 Platform: Windows10

BobBorges commented 2 years ago

Same!

jay0x5 commented 2 years ago

@BobBorges i solved this by writing my code in javascript and using Js IPFS lib looks like python lib is abandoned

BobBorges commented 2 years ago

@jay0x5 I've seen similar comments in other places too – problem is, I just hate javascript. I went into my package files and changed the VERSION_MAXIMUM variable to "0.13.0", line 19 in client/__init__.py. After that it allows me to connect and add(). I haven't fully explored the consequence of this hack (I'm still trying to wrap my head around IPFS in general) – but I suppose if it would be so simple someone else would have done this already.

jay0x5 commented 2 years ago

@BobBorges Nice hack! i wish i knew it earlier :( Please keep me updated here or you may contact me on email: contactjay0x5@gmail.com would love to see how it goes!

willcharlton commented 2 years ago

Same. Is this repo abandoned then?

jay0x5 commented 2 years ago

@willcharlton yep! its abandoned :(

Bird-NZ commented 2 years ago

I'm getting a similar issue with trying to connect using python "VersionMismatch: Unsupported daemon version '0.11.0' (not in range: 0.4.22 ≤ … < 0.7.0)" If this is abandoned how else can I connect to IPSF via something like infura and interact with IPFS? Any pointers from here people for a bit of IPFS action via python?

willcharlton commented 2 years ago

@Bird-NZ - this looks promising: https://gitlab.com/cipres/aioipfs

vaishnavvp commented 2 years ago

@BobBorges I've seen similar comments in other places too – problem is, I just hate javascript. I went into my package files and changed the VERSION_MAXIMUM variable to "0.13.0", line 19 in client/__init__.py. After that it allows me to connect and add(). I haven't fully explored the consequence of this hack (I'm still trying to wrap my head around IPFS in general) – but I suppose if it would be so simple someone else would have done this already.

not working for me any other solution ipfshttpclient.exceptions.VersionMismatch: Unsupported daemon version '0.13.0' (not in range: 0.4.18 ≤ … < 0.5.0)

crushr3sist commented 2 years ago

For anyone wondering, this is abandoned, I have been told by a "higher up". Use subprocess and interact with the software through that, there's no excuse to use the older version just to make it work with python. However, it doesn't discredit the daemon.

veqtor commented 2 years ago

It's absolutely absurd that ipfs doesn't have a working client in python

superswan commented 2 years ago

@jay0x5 I've seen similar comments in other places too – problem is, I just hate javascript. I went into my package files and changed the VERSION_MAXIMUM variable to "0.13.0", line 19 in client/__init__.py. After that it allows me to connect and add(). I haven't fully explored the consequence of this hack (I'm still trying to wrap my head around IPFS in general) – but I suppose if it would be so simple someone else would have done this already.

This solution has worked for me. I was successfully able to connect, add a new file and access it from a public gateway. Thanks. Is this project no longer maintained?

willcharlton commented 2 years ago

@jay0x5 I've seen similar comments in other places too – problem is, I just hate javascript. I went into my package files and changed the VERSION_MAXIMUM variable to "0.13.0", line 19 in client/__init__.py. After that it allows me to connect and add(). I haven't fully explored the consequence of this hack (I'm still trying to wrap my head around IPFS in general) – but I suppose if it would be so simple someone else would have done this already.

This solution has worked for me. I was successfully able to connect, add a new file and access it from a public gateway. Thanks. Is this project no longer maintained?

It appears that it is abandoned. Has anyone on this thread evaluated https://gitlab.com/cipres/aioipfs?

hemangjoshi37a commented 1 year ago

Hi everyone,

I'm a contributor to the py-ipfs-http-client project and I've noticed this thread.

Firstly, I'm sorry to hear that many of you are having issues with daemon version mismatches. I understand this is frustrating and it's certainly not the experience we want for our users.

The issue you're experiencing is due to the client library being out of sync with the newer versions of the IPFS daemon. This is a known issue and we are currently working on a solution to support the latest versions of the daemon.

In the meantime, as some of you already suggested, you can manually change the VERSION_MAXIMUM variable in the client/__init__.py file to match the version of your daemon. However, please note that this is a temporary solution and we don't recommend it for production use as it might lead to unexpected errors and behavior.

@willcharlton, thanks for pointing out the aioipfs library. That's indeed a viable alternative, although it might not have all the features of the py-ipfs-http-client.

@Wizock, interacting with the IPFS daemon directly via subprocesses is also an option, but that could be more complex and error-prone.

sudama011 commented 8 months ago

@jay0x5 I've seen similar comments in other places too – problem is, I just hate javascript. I went into my package files and changed the VERSION_MAXIMUM variable to "0.13.0", line 19 in client/__init__.py. After that it allows me to connect and add(). I haven't fully explored the consequence of this hack (I'm still trying to wrap my head around IPFS in general) – but I suppose if it would be so simple someone else would have done this already.

This worked for me. Thanks

pinnaculum commented 7 months ago

Hello, i'm the author of aioipfs, which at the moment supports the RPC API of kubo v0.27.0. I think there will always be a need for a synchronous python ipfs client library like ipfshttpclient for small scripts and existing programs that don't use asyncio and need to interact with IPFS.

I remember that with py-ipfs-http-client, instead of using .connect(), you can instantiate a Client directly without doing the version detection ?