-
Notifications
You must be signed in to change notification settings - Fork 178
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
"cannot import name 'quantiles' from 'statistics'" in Joinmarket 0.9.7 #1340
Comments
Yep, https://docs.python.org/3/library/statistics.html#statistics.quantiles I'm not familiar with Raspbian at all, if updating Python is not an option, as a quick solution you can comment (#) out the import |
Awesome, thanks for the tip, I'll update it. Might be worth adding the 3.8+ requirement to the installation readme |
I think JM wants to support 3.7 still (not sure for how long), EOL is coming I think. |
We still have |
@PulpCattel I guess there's a relatively natural solution here: First, I see from the relevant import in Indeed it would be silly to have this stop 3.7 working, so it's an oversight on our part. I guess it comes out of the fact that our test suite doesn't run the actual user level scripts. |
That also, but mostly the idea was/is to reuse
Yeah, the incriminated function is only used for the orderbook stats, so we could add a note in We can also replace the function with a (inspired) custom one: def percentiles(data):
n = len(data)
if n < 2:
raise ValueError('must have at least two data points')
data = sorted(data)
m = n - 1
result = []
for i in range(1, 100):
j, delta = divmod(i * m, 100)
interpolated = (data[j] * (100 - delta) + data[j + 1] * delta) / 100
result.append(interpolated)
return result I didn't test it much but it should be the same.
Yep, absolutely. Breaking compatibility with old Python versions wasn't ofc planned. |
After installing the newest Joinmarket, version 0.9.7, I get the following when trying to run
python wallet-tool.py wallet.jmdat
I have Python 3.7.3 on a Raspbian machine
I installed Joinmarket by downloading the tar.gz and running install.sh - everything worked fine as always.
Any idea why this is happening? Seems like a python version thing, but python3 should work.
The text was updated successfully, but these errors were encountered: