Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Upgrade matplotlib to the latest
-
I manage to download the latest matplotlib 1.5.1 using pipista. However, I dont know how to replace current matplotlib (1.3) and using it in my code.
I couldnt run below code using current matplotlib:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use("ggplot")x = [1, 5, 1.5, 8, 1, 9]
y = [2, 8, 1.8, 8, 0.6, 11]plt.scatter(x,y)
plt.show()Any help would be appreciated.
Many Thanks.
-
I believe that you need to put it in
site-packages
And then quit and relaunch Pythonista.import matplotlib print(matplotlib.__version__) print(matplotlib.__version__numpy__)
-
Do I need extract the downloaded file (tar.gz) and then place it inside site-packages ?
-
it is not obvious that you can upgrade matplotlib. Much of matplotlib is c code, and version 1.3 to 1.5 had changes to thousands of lines of c. While you might get some bits to work, it seems unlikely it will behave as 1.5 is supposed to.
-
Thanks for the answer.
Is there any workaround, so I can use 1.5 lib for my code ?
How about upgrade other modules like numpy, or install new module like sklearn.
Is it possible ? -
No, you can only install pure Python modules yourself. Modules such as
numpy
andmatplotlib
that use C, Cython, Fortran or other compiled languages need to be integrated into Pythonista by omz, because Apple's app guidelines do not allow compiling native code in an app, and simply because there are no C compilers for iOS on iOS.