Forum Archive

I Can’t compile matplotlib in Pythonista

navillegas

I just buy Pythonista on my iPad 2018, but I have issues in compiling a script which uses matplotlib. Is there any easy way to fix it?. Regards,

JonB

Try posting your traceback. There are many reasons you might have problems.

navillegas

Hi!, There is not traceback. The editor start running and stops in the line where the mat plot lib library is called: (import matplotlib.pyplot as plt). A red box arises which says: Operation not permitted. I’d wish to send you a screenshot but I am unable to attach a picture.

JonB

If you expand the red box, there should be a place that says print traceback. Do that

navillegas

I did that, the traceback says:

Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/979E2583-F740-4860-ACFA-8FDD0F71B319/File Provider Storage/111342185/local-storage/L3Byb2dyYW1pbmcvcHJvZ3JhbWFjacOzbi9wcm9ncmFtYXNfbmVyeS9jYWxjL2NhbGMucHk=/calc.py", line 2, in
import matplotlib.pyplot as plt
File "/var/containers/Bundle/Application/3115F116-9E2E-4169-B4EB-3610A354BDDF/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/matplotlib/init.py", line 1050, in
rcParams = rc_params()
File "/var/containers/Bundle/Application/3115F116-9E2E-4169-B4EB-3610A354BDDF/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/matplotlib/init.py", line 899, in rc_params
fname = matplotlib_fname()
File "/var/containers/Bundle/Application/3115F116-9E2E-4169-B4EB-3610A354BDDF/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/matplotlib/init.py", line 750, in matplotlib_fname
fname = os.path.join(os.getcwd(), 'matplotlibrc')
PermissionError: [Errno 1] Operation not permitted

JonB

you must move your main script to Documents ( a folder under This Ipad)

when you open another apps file, that path is read only