Hi Andrey! Thank you for your answer and sorry for my delay. For fipy the 'exec' is the solution and it helps me a lot during manipulating of strings to send to SageMathCell with sagecell-client, so to use fipy with the sagecell-client script user needs only to execute python string with 'exec' inside Sage language.
About sfepy and other python libraries installable via conda (no pip), I tested a way to install temporary a miniconda distribution in order to install some python libraries that can't be installed with common pip: this way is not so convenient because it is time/power consuming, but could be a starting point for me: miniconda3 installation on current cell <https://sagecell.sagemath.org/?z=eJyFkMFKA0EMhu-FvkNkhZ6yc1CK9KoXQdGbR8nuTm1wJrvMZGv79mYqdKHI9hbm_yZfkqqq4FmyUggQWbjtpaO7zXJxE787ToAD3L5_PLkps-jnyyvsVIe8cS75oa9J6JTWbR8n1r2ef2Eg9VnxhWU84OFh_bm-r_MO8O2y_1RabrKGDJtjABvA8f9JUwRM2yuK5aKyKzwmbyPC4FPuhQJ42QMLdH5LY1Aox1jZW14BSQfUKu8Lz1qOdSloWNyptBasUHaYpdo_OR4BBeLRPLP42X4dLWsEzvoLWJuh9Q==&lang=sage&interacts=eJyLjgUAARUAuQ==> I have a problem about activating personal environment with 'conda activate myenv', I will try to solve it if I can. 'conda install' has --no-deps option to install package without dependencies, but I'm trying to understand if it is possible to install temporarily only dependencies not present in SageMathCell (I'd like to avoid to install scipy, numpy, etc.. in conda environment, because them are already built-in). For now I'm doing some experiments with conda on linux by using SageMathCell and when I will have a working solution that can install sfepy and run any example script of that package, I will try to download from the cell the zipped folder with miniconda, sfepy and all dependencies for future use. This only to test on the fly some not-pip installable python libraries, available only via conda-forge or conda. Thank you again Andrey for your continued support on this powerful and versatile cloud computing software (SageMathCell). Best regards Matteo Il giorno domenica 7 marzo 2021 alle 23:20:15 UTC+1 [email protected] ha scritto: > On Wednesday, 17 February 2021 at 22:55:20 UTC-7 [email protected] > wrote: > >> Hi Andrey, thank you very much for your time! >> >> I tried Fipy and it works very well. I used an example script (slightly >> modified) by Fipy authors (only to test the package) and I've seen that >> it works only if I enable "Python" as interpreter. If I use "Sage" >> interpreter I obtain error "No attribute 'shape'". >> >> The two permalink are the following: the first is ok with Python >> interpreter, the second can't work due to the "Shape" error when executed >> with Sage interpreter: >> >> >> 1. with Python as interpreter >> >> <https://sagecell.sagemath.org/?z=eJyFU7Fu2zAQ3QXoHw4ZGsoQVNlbijBDI6CLp9YIkklgLComIJIKSbkS0I_vkaITOU5RDxb5ePfeu-OxNVpCK_oJhOy1cXDPu-6BGcGeO57DDyOaTZXDg-C_uclhZ5iygiu340bmUIm2HazQym_TpD2RFU7rzp4o1SC5EWOapIkagcK6LHE14Uoh2HioLNa48lCD0DZ8YRXOJbcH3M9OSDPSZsyhmWgz5XhOFe7URNWUpUl_EBi5rIAoJjliV1Z3g0OjcIwnV3mawOUvqvnP5wFH1g08OEbByldTpAl_xcVZb0gGlJ73h-w1b1taYV4g2el-y1vnuSLyXTun5U_xcvDo2jfsMYen6Kdo2Z7fIz83FnuNG_tOQchbiA3QFyBPcAdb-AqbLLss5Q8sMpDHJzzC7SkhiwrnlpYqMxZkbv8tcyE1E85qdwu1cHvFXivrDBOKLFuUw7La7NPQhdEYvkACvxOS_3K8rwbDwij4ScQhK4sb_G_G1WqDbsgGN1VIEC3UtR-guvaXeV3XEuXq-vrbXOcxPAqkmV8H-jCWojUcT-aYFIqWRVyzka6LbJlW9J12JOhYNGWR5ia-oOdBdE6ot_eDc_XC8Uwb8KEg1AyRkJhFN_y1wCE_cm8juPhwGY2jHzsQDf2vzgvTfwHt4DrX&lang=python&interacts=eJyLjgUAARUAuQ==> >> 2. with Sage as interpreter >> >> <https://sagecell.sagemath.org/?z=eJyFU7Fu2zAQ3QXoHw4ZGsoQVNlbijBDI6CLp9YIkklgLComIJIKSbkS0I_vkaITOU5RDxb5ePfeu-OxNVpCK_oJhOy1cXDPu-6BGcGeO57DDyOaTZXDg-C_uclhZ5iygiu340bmUIm2HazQym_TpD2RFU7rzp4o1SC5EWOapIkagcK6LHE14Uoh2HioLNa48lCD0DZ8YRXOJbcH3M9OSDPSZsyhmWgz5XhOFe7URNWUpUl_EBi5rIAoJjliV1Z3g0OjcIwnV3mawOUvqvnP5wFH1g08OEbByldTpAl_xcVZb0gGlJ73h-w1b1taYV4g2el-y1vnuSLyXTun5U_xcvDo2jfsMYen6Kdo2Z7fIz83FnuNG_tOQchbiA3QFyBPcAdb-AqbLLss5Q8sMpDHJzzC7SkhiwrnlpYqMxZkbv8tcyE1E85qdwu1cHvFXivrDBOKLFuUw7La7NPQhdEYvkACvxOS_3K8rwbDwij4ScQhK4sb_G_G1WqDbsgGN1VIEC3UtR-guvaXeV3XEuXq-vrbXOcxPAqkmV8H-jCWojUcT-aYFIqWRVyzka6LbJlW9J12JOhYNGWR5ia-oOdBdE6ot_eDc_XC8Uwb8KEg1AyRkJhFN_y1wCE_cm8juPhwGY2jHzsQDf2vzgvTfwHt4DrX&lang=sage&interacts=eJyLjgUAARUAuQ==> >> >> >> I'm just curious: why it happens? >> > > Hi Matteo, > > I see what is happening, but don't understand what is the issue. It is, > however, not specific to SageMathCell, perhaps ask on sage-support for more > help? > > >> Another question: can I choose the interpreter (maxima, python, octave, >> sage, gap, html, ecc...) available on web page of SageMathCell also by >> using the script sagecell-client.py >> <https://github.com/sagemath/sagecell/blob/master/contrib/sagecell-client/sagecell-client.py>? >> >> Inside this script, where I should set the interpreter for execution of the >> string in the filed "a.execute_request(...)"? >> > > No, handling of the language setting is done in JavaScript > https://github.com/sagemath/sagecell/blob/master/js/session.js#L322 which > is bypassed by Python scripts. For your case, however, all is done is > wrapping the code in exec. > >> >> About Sfepy you are right, I know it is not available a pip version of >> it. Do you think a possible solution could be to install permanently >> Miniconda for Linux, so user could use both "!pip install ..." and "!conda >> install ...." in the temporary opened cell before a calculation? Every >> installation on local cell (via pip or conda) would be deleted after >> execution. I propose this only to solve problems related to python >> libraries that can't be installed with common "pip" but that can be >> installed only with "conda" when user needs to try some of these libraries, >> only for quick tests, because installable conda packages are usually >> pre-compiled libraries for some platforms, like Sfepy as we can see at >> https://anaconda.org/conda-forge/sfepy. >> >> Do you think the command "!conda install ..." could work like "!pip >> install ..." in current cell by using the "--target" option, in order to >> install temporary a python lib inside the working cell, only to test it, >> not to install it permanently? >> > > "pip installed" packages are actually installed by pip included in Sage, > so to make it work in the same way conda has to be included into Sage. I > think that the efforts now are on making Sage a pip-installable library > instead of adding more package managers into Sage. > >> >> And last question, with both "!conda install ..." and "!pip install ..." >> executed inside the current working cell is it possible to ignore >> dependencies installation by using the pip option "--no-dependencies"? >> This because I prefer that, for example, a Scipy based python library (that >> I'd like to test on SageMathCell only one time) uses the SageMathCell >> built-in Scipy version instead of to install in current cell the entire >> Scipy lib as dependency (that is time consuming). >> >> Can you give a full example you are working with so I can see what is > happening? Seems to me that you can pass --no-dependencies option just > fine. > > Thank you! > Andrey > > >> Thank you! >> Regards >> Matteo >> >> Il giorno domenica 14 febbraio 2021 alle 23:05:39 UTC+1 [email protected] >> ha scritto: >> >>> Hi Matteo, >>> >>> I've install fipy (should be available in a few hours), but sfepy is not >>> available via pip, so it is not obvious to me how to make it available to >>> Sage. >>> >>> Best, >>> Andrey >>> >>> On Tuesday, 9 February 2021 at 09:24:48 UTC-7 [email protected] >>> wrote: >>> >>>> Hi all! First of all thank you Andrey for SageMathCell. Sorry if I use >>>> this thread but I have seen that here there are many requests about >>>> installation of specific python libraries. >>>> >>>> So, if it's useful for you too and Andrey agrees, I'd like to try the >>>> following libraries in SageMathCell (that I use mainly with a modified >>>> version of the script sagecell-client.py >>>> <https://github.com/sagemath/sagecell/blob/master/contrib/sagecell-client/sagecell-client.py> >>>> >>>> that works easily on a smartphone with python installed as app) to find >>>> numerical solutions of PDEs: >>>> >>>> - Fipy (https://www.ctcms.nist.gov/fipy/index.html): finite volume >>>> methods >>>> - Sfepy (http://sfepy.org/doc-devel/index.html): finite elements >>>> methods >>>> >>>> Thank you >>>> Regards >>>> Matteo >>>> >>>> Il giorno domenica 7 febbraio 2021 alle 18:05:29 UTC+1 >>>> [email protected] ha scritto: >>>> >>>>> Ingo: SageMathCell uses preforked kernels, so when you are trying to >>>>> execute a cell it is already up and running, waiting for your code. If >>>>> you >>>>> can activate extra modules from a running session, e.g. by downloading >>>>> and >>>>> importing a module, you can already do it. If you want to install >>>>> something >>>>> on the system and then start a kernel - that's completely different >>>>> approach (which is available to you in CoCalc). The rate of requests for >>>>> new modules is not that big, so I am happy to add anything you want and >>>>> it >>>>> will be available by default. Of course, this assumes that this anything >>>>> can be installed via standard means and be functional. >>>>> >>>>> Elimboto: this is not the case for Tk, Turtle, or Dash/Flask. I could >>>>> not figure out a way to use Turtle on on a headless machine without >>>>> displaying anything, although it seems there are ways to save plots after >>>>> they have been shown. If you can dig up instructions on how to do it - I >>>>> will be happy to incorporate them. For Dash I am still unclear what >>>>> exactly >>>>> you are are trying to accomplish and so what should work. If you are >>>>> trying >>>>> to create some interactive interface, you are unlikely to do anything >>>>> apart >>>>> from using ipywidgets or its @interact wrappers. All communication in >>>>> SageMathCell is passing through IPython framework, nothing else is going >>>>> to >>>>> work without substantial efforts like implementing X11 protocol similar >>>>> to >>>>> William's work in CoCalc. >>>>> >>>>> pyswarms, pydot, graphviz, folium and openpyxl have been added to >>>>> public servers! >>>>> >>>>> Best, >>>>> Andrey >>>>> >>>> -- You received this message because you are subscribed to the Google Groups "sage-cell" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/4c93093f-ef95-42e1-83ea-71d66a491715n%40googlegroups.com.
