ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 02 Jun 2021 11:35:46 +0200SAGE - python3 problem import multiprocessing_logginghttps://ask.sagemath.org/question/57402/sage-python3-problem-import-multiprocessing_logging/Dear Collegues,
I need help , I'm trying two days and got headheach:(
system: UBUNTU 20.04
installed SAGE - 64 bit
Python version 3.8
problem is with import modules:
ubuntu@ubuntu2010:~/Desktop/APPS/bdd-predicate$ sage -python3 ecdsa_cli.py
Traceback (most recent call last):
File "/home/ubuntu/Desktop/APPS/bdd-predicate/ecdsa_cli.py", line 14, in <module>
from multiprocessing_logging import install_mp_handler
ModuleNotFoundError: No module named 'multiprocessing_logging'
but i have installed:
Python 3.8.6 (default, May 27 2021, 13:28:02)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing_logging
>>>
when I want to once again install multiprocessing_logging:
ubuntu@ubuntu2010:~/Desktop/APPS/bdd-predicate$ pip3 install multiprocessing_logging
Requirement already satisfied: multiprocessing_logging in /usr/local/lib/python3.8/dist-packages/multiprocessing_logging-0.3.1-py3.8.egg (0.3.1)
ubuntu@ubuntu2010:~/Desktop/APPS/bdd-predicate$
how to solve this problem?
please help,MiroslawWed, 02 Jun 2021 11:35:46 +0200https://ask.sagemath.org/question/57402/Sage in python no module called sage.allhttps://ask.sagemath.org/question/54875/sage-in-python-no-module-called-sageall/So I think I'm suppose to write the line from sage.all import * in my python script which raises the error
File "c:/Users/user/Downloads/PyFolder/umphy.py", line 2, in <module>
from sage.all import *
ModuleNotFoundError: No module named 'sage.all'
So I tried installing sage in python.
PS C:\Users\user> pip install sage
Requirement already satisfied: sage in c:\users\user\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (0.0.0) standardtrickynessWed, 23 Dec 2020 20:42:06 +0100https://ask.sagemath.org/question/54875/Is it possible to run (may be partially) Sage with Python 3?https://ask.sagemath.org/question/33887/is-it-possible-to-run-may-be-partially-sage-with-python-3/ I want to run sage with python3. I know that it isn't fully ported, but I want to use already ported functionality and hope it cover my needs.
One particular reason is my necessity to use `multiprocessing.pool` with `lambda` function which doesn't work with python 2 and [both workarounds](http://stackoverflow.com/questions/4827432/how-to-let-pool-map-take-a-lambda-function ) seem to not work also.
P.S. I found [third workaround](http://stackoverflow.com/a/37976180/359866) which seems to be working.petRUShkaWed, 22 Jun 2016 19:52:59 +0200https://ask.sagemath.org/question/33887/Is it possible to update the Sage Python?https://ask.sagemath.org/question/37181/is-it-possible-to-update-the-sage-python/ I noticed Sage can run a Python notebook, but it's 2.7 when I'm used to using 3.x. It is possible to update the Python in Sage? Also I'm on Windows so I'm using the Sage Virtualbox appliance, which might make it impossible. But is it possible in a sage native host like Linux?cybervigilanteWed, 05 Apr 2017 23:13:53 +0200https://ask.sagemath.org/question/37181/"print" statement vs function for Sage-py3https://ask.sagemath.org/question/45994/print-statement-vs-function-for-sage-py3/With the upcoming migration of Sage from Python2 to Python3, I was wondering if Sage's default new behavior will be the current `print` statement (e.g., `print 'hello'`) or will it change to Python3's `print` command (e.g., `print('hello')`).
In case of a change from the current behavior, will there be a way to keep backwards compatibility for code written Python2-style?
Thanks for your answers!dsejasTue, 02 Apr 2019 22:56:46 +0200https://ask.sagemath.org/question/45994/Is it possible to use python3?https://ask.sagemath.org/question/36088/is-it-possible-to-use-python3/I just learnt python3.
But i came to know after installing sage that it use python2?
Do I have a future in sage?
I don't prefer to use the cloud, but the package i have?
>What should I do now? screened00Sun, 25 Dec 2016 19:41:13 +0100https://ask.sagemath.org/question/36088/How to implement "positional-only parameter" in a user defined function?https://ask.sagemath.org/question/43959/how-to-implement-positional-only-parameter-in-a-user-defined-function/def fun( a, b, /):
print(a,b)
o/p:
File "<ipython-input-36-1fceb840aeb9>", line 1
def fun( a, b, /):
^
SyntaxError: invalid syntaxdamodarTue, 16 Oct 2018 11:23:40 +0200https://ask.sagemath.org/question/43959/Is there any difference between the variables b and *b in these two statements? If so, what is it?https://ask.sagemath.org/question/43966/is-there-any-difference-between-the-variables-b-and-b-in-these-two-statements-if-so-what-is-it/
(a, b, c) = 1, 2, 3
(a, *b, c) = 1, 2, 3damodarTue, 16 Oct 2018 15:54:43 +0200https://ask.sagemath.org/question/43966/list as a function parameter.https://ask.sagemath.org/question/43939/list-as-a-function-parameter/.
>>> def fun(x, b= []):
... b.append(x)
... print(x,' ',b)
...
>>> fun(7)
7 [7]
>>> fun([9, 7])
[9, 7] [7, [9, 7]]
>>> fun([9, 8])
[9, 8] [7, [9, 7], [9, 8]]
>>>damodarSun, 14 Oct 2018 00:25:51 +0200https://ask.sagemath.org/question/43939/How to call nested tuple and nested set or dictionary using variable argument and variable keyword argument methods ?https://ask.sagemath.org/question/43921/how-to-call-nested-tuple-and-nested-set-or-dictionary-using-variable-argument-and-variable-keyword-argument-methods/.
def arithmetic_mean(first, *values):
""" This function calculates the arithmetic mean of a non-empty
arbitrary number of numerical values """
return (first + sum(values)) / (1 + len(values))
x= [('a', 232), ('b', 343), ('c', 543), ('d', 23)]
y= [[('a', 232), ('b', 343), ('c', 543), ('d', 23)]]
how to pass x and y inside arithmetic_mean.
can it be possible through zip method?damodarThu, 11 Oct 2018 20:16:34 +0200https://ask.sagemath.org/question/43921/Python3 MigrationStatushttps://ask.sagemath.org/question/43848/python3-migrationstatus/Hello. I looked at Trac , but I couldn't make out just how far we are into migrating to python3. Looks to me that most issues are closed by now. I'd appreciate quick summary from a sage developer.rijndaelxyzSat, 06 Oct 2018 22:38:40 +0200https://ask.sagemath.org/question/43848/make ptest fails after compilation based on Python3https://ask.sagemath.org/question/42924/make-ptest-fails-after-compilation-based-on-python3/I installed sagemath 8.3rc0 on my fedora 28 linux x86_64 system using the following commands:
make configure
./configure --prefix=$HOME/sage --with-python=3 --with-mp=gmp
make build
This seemed to have installed sage successfully but when I run tests with:
$ make ptest
I get the following errors and make ptest fails:
[manifolds] from Queue import Queue
[manifolds] ModuleNotFoundError: No module named 'Queue'
OSError: [manifolds] /home/user/sagemath/inst/lib/python3.6/site-packages/sage/manifolds/differentiable/curve.py:docstring of sage.manifolds.differentiable.curve.DifferentiableCurve:58: WARNING: Exception occurred in plotting curve-1
[dochtml] [manifolds] dumping object inventory... done
[dochtml] [manifolds] build succeeded.
[dochtml] [manifolds] The HTML pages are in ../inst/share/doc/sage/inventory/en/reference/manifolds.
[dochtml] Error building the documentation.
Error building Sage.
The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):
* documentation: dochtml
log file: /home/user/sagemath/src/logs/pkgs/../dochtml.log
The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
make[1]: *** [Makefile:33: all-start] Error 1
make[1]: Leaving directory '/home/user/sagemath/src'
make: *** [Makefile:13: all] Error 2
I believe one of the `OSError` or the `dochtml` error is causing `make ptest` to fail. Can I get advice on how I can correct these problems?number123Wed, 11 Jul 2018 17:19:16 +0200https://ask.sagemath.org/question/42924/Performance Upgrades With Python3?https://ask.sagemath.org/question/42945/performance-upgrades-with-python3/Are there any? o6pThu, 12 Jul 2018 12:07:07 +0200https://ask.sagemath.org/question/42945/Differences between Python2 Sagemath and Python3 Sagemath?https://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/ With sagemath looking to move away from python2 in 2020 and as a new user of sagemath, I wanted to know what the differences are between Python2 Sagemath and Python3 Sagemath?
At the moment sagemath is not fully compatible with python3 and I have been told to expect problems. I want to know how serious these problems are and how frequent they are. I would then be able to know if using python3 sagemath is worth the trouble.number123Wed, 11 Jul 2018 21:35:20 +0200https://ask.sagemath.org/question/42932/Python 3 print in Sagehttps://ask.sagemath.org/question/38805/python-3-print-in-sage/ This is a minor issue, but I've long migrated all my Python scripts to Py3, so I'm trying to write in Sage in the most Py3-compliant way possible, since we'll have Py3 support in a not-so-distant future according to the FAQs (frankly I'm a bit surprised that Py3 support haven't already happened, but, oh well).
Anyway, because of that I put `from __future__ import print_function, division` in the very first line of my `init.sage`.
If I type things interactively in the prompt, it works as it's supposed to:
sage: print('C_r' ,6)
C_r 6
However, if I run a script with `load('my_script.sage')` it prints things as if I was using Py2.
('C_r', 6)
Am I loading my scripts wrong? How can I get it to work for scripts too?
Cheers.tomchoTue, 12 Sep 2017 18:40:04 +0200https://ask.sagemath.org/question/38805/Using a python 3 class in SageMathhttps://ask.sagemath.org/question/35564/using-a-python-3-class-in-sagemath/I wrote a class that uses some python 3 features (specifically, functools.lru_cache).
When I try to import it into my SageMath notebook, I get errors, since the notebook runs on Python 2.7.
I read in this FAQ: http://doc.sagemath.org/html/en/faq/faq-usage.html
that the answer to the question "Can I use Sage with Python 3.x?"
is: "Currently, no. Sage depends on the SciPy stack of Python numerical and scientific packages. As of 2010, SciPy still uses Python 2.x. So until SciPy is ported to run with Python 3.x and Cython supports Python 3.x, Sage will continue to use Python 2.x."
But, this answer is from 2010. Now it's 2016, and SciPy already supports Python 3.
So, my questions are:
* Is it possible now to use SageMath with Python 3
* If not, is there a workaround I can use to import my class to SageMath notebook?Erel Segal-HaleviMon, 14 Nov 2016 10:41:16 +0100https://ask.sagemath.org/question/35564/Running python on sagehttps://ask.sagemath.org/question/24461/running-python-on-sage/I understand that python interfaces with sage but why do some people run a python module on sage? Is it because of memory reasons, graphical availability, etc?
Thanks.
Mee Seong ImSat, 11 Oct 2014 17:42:42 +0200https://ask.sagemath.org/question/24461/Python compiler in Sage Notebookhttps://ask.sagemath.org/question/9298/python-compiler-in-sage-notebook/Do you know which version of Python has been providing in Sage Notebook?FastfootWed, 05 Sep 2012 18:02:26 +0200https://ask.sagemath.org/question/9298/python 3.xhttps://ask.sagemath.org/question/8926/python-3x/I read previously that Sage would support python 3 when SciPy and Cython worked with 3.x. Since both SciPy and Cython now both support 3.x is Sage also now compatible? I am waiting to use Sage until it works with Python3.kramer11xWed, 25 Apr 2012 15:07:42 +0200https://ask.sagemath.org/question/8926/Support for python 3? (yes, I've read the FAQ)https://ask.sagemath.org/question/8430/support-for-python-3-yes-ive-read-the-faq/According to Sage's FAQ:
http://www.sagemath.org/doc/faq/faq-usage.html#can-i-use-sage-with-python-3-x
"Until SciPy is ported to run with Python 3.x and Cython supports Python 3.x, Sage will continue to use Python 2.x"
Scipy has been ported to Python 3.x, and Cython already works with Python 3.x. Are there any plans to port Sage to Python 3.x?
oscarvartoWed, 02 Nov 2011 19:39:09 +0100https://ask.sagemath.org/question/8430/