• JonB

    I will also say, that running pip install plotly with latest stash caused pip to install all of the plotly folders into site-packages-3, instead of the plotly folder, which totally borked pythonista, and it crashes immediately upon open, even with safemode and pythonista3://. could possibly be my fault for hitting ctrl-z during the process.

    so... don't do that

    posted in Pythonista read more
  • JonB

    I finally got around to trying this on the latest stash. @bennr01, it seems the issue is that pip is not detecting doendencies using the whl.

    Because of this, it is necesary to manually instal each dependency:

    rm -f site-packages*/requests
    rm -f site-packages*/chardet
    rm -f site-packages*/idna
    
    pip install requests
    pip install chardet
    pip install idna
    

    Do this all before running any other pip commands after starting the app.
    The last three must be done within a single sesson.
    Then force quit pythonista. import requests, and all should be happy.

    @bennr01 here is the whl install, showing it couldnt find dependencies.

    [~/Documents]$ pip install chardet
    Querying PyPI ... 
    Downloading package ...
    Opening: https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
    
    Save as: /private/var/mobile/Containers/Data/Application/06FD02C2-F3B4-4512-8629-018C9F64EA15/tmp/chardet-3.0.4-py2.py3-none-any.whl (133356 bytes)
        133356  [100.00%]
    Installing wheel: chardet-3.0.4-py2.py3-none-any.whl...
    Extracting wheel..
    Extraction finished, running handlers...
    Running handler 'WHEEL information checker'...
    Wheel generated by: bdist_wheel (0.29.0)
    Running handler 'dependency handler'...
    Running handler 'top_level.txt installer'...
    Copying /private/var/mobile/Containers/Data/Application/06FD02C2-F3B4-4512-8629-018C9F64EA15/tmp/wheel_tmp/chardet-3.0.4-py2.py3-none-any.whl/chardet -> /private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Pythonista3/Documents/site-packages-3
    Running handler 'console_scripts installer'...
    Cleaning up...
    Package installed: chardet
    [~/Documents]$ pip install idna
    Querying PyPI ... 
    Downloading package ...
    Opening: https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
    
    Save as: /private/var/mobile/Containers/Data/Application/06FD02C2-F3B4-4512-8629-018C9F64EA15/tmp/idna-2.8-py2.py3-none-any.whl (58594 bytes)
         58594  [100.00%]
    Installing wheel: idna-2.8-py2.py3-none-any.whl...
    Extracting wheel..
    Extraction finished, running handlers...
    Running handler 'WHEEL information checker'...
    Wheel generated by: bdist_wheel (0.32.2)
    Running handler 'dependency handler'...
    Warning: could not find 'metadata.json', can not detect dependencies!
    Running handler 'top_level.txt installer'...
    Copying /private/var/mobile/Containers/Data/Application/06FD02C2-F3B4-4512-8629-018C9F64EA15/tmp/wheel_tmp/idna-2.8-py2.py3-none-any.whl/idna -> /private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Pythonista3/Documents/site-packages-3
    Running handler 'console_scripts installer'...
    No entry_points.txt found, skipping.
    Cleaning up...
    Package installed: idna
    [~/Documents]$ ls site-packages-3
    
    site-packages-3/:
    Readme.md chardet idna midiutil requests
    

    posted in Pythonista read more
  • JonB

    bs4 and requests come preinstalled, no reason to update, which usually only causes issues

    posted in Pythonista read more
  • JonB

    aanother one is npdl (numpy deep learning)

    posted in General Discussion read more
  • JonB

    Only pure python, or numpy only dependencies.
    You might take a look at Tensor Slow, which seems to be numpy based tensorflow alternative.

    posted in General Discussion read more
  • JonB

    @ihf shortcuts supports x-callback-urls
    https://support.apple.com/guide/shortcuts/use-x-callback-url-apdcd7f20a6f/ios

    So, you should be able to call shortcuts from pythonista, and then have shortcuts reopen pythonista after

    posted in Pythonista read more
  • JonB

    One option is to use sagemath, which let's you run code in the cloud. If you search the forums for sagecell or sagemath, there were some scripts to allow wrench actions to run a py script on the cloud

    posted in General Discussion read more
  • JonB

    The difference is that things like CGRect and the like are structures, not full fledged objects. CGRectMake is not a real function, but an inlined function that gets optimized away by the obj compiler, and so there is nothing to call.

    You either have to find someone who has done the work and converted the library to python ctypes lib that you can import, or else do it yourself. Rubicon is a good place to look for much of the the core stuff

    posted in Pythonista read more
  • JonB

    def CGRectMake(x,y,w,h): return CGRect((x,y),(w,h))
    Basically, you have to define your own wrappers, stick them in a library that you import, along with the various constants that you need, etc, and just import it.

    See for example
    https://github.com/pybee/rubicon-objc/blob/master/rubicon/objc/types.py

    Near the end, they define many useful structs, constant structures, and non-exported utility functions. Mostly this is just pure ctypes.

    posted in Pythonista read more
  • JonB

    CGRectMake is not actually a function in the symbol table, I think it is more of a preprocessor thing.

    For things like CGRect, which are structures, not objects, you have to define the ctypes structure, then use the ctypes constructor methods, or manually set the fields. You could create your own wrapper functions that set the fields that you want to use, since sometimes there are fields that you can leave set to 0.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!