In another email, I talked about the TEXMACS_HOME_PATH way to solve the missing 
(python-command) problem.



As Max said, to solve the problem:



1. Make the python detector smarter, a python subfolder should be created: 
https://github.com/texmacs/texmacs/tree/master/TeXmacs/progs/utils

2. A preference for user to choose the proper python path, the preference is 
stored in $TEXMACS_HOME_PATH/system/preferences.scm and a dialog can be 
prompted to modified it



For a smarter Python detector, it will:

+ detect the system path (Windows Store provided/Linux preinstalled 
Python/macOS preinstalled Python)

+ detect the conda binary and envs

+ detect the poetry binary and related envs





---- On Sat, 2020-12-12 02:03:20 Massimiliano Gubinelli <m.gubine...@gmail.com> 
wrote ----



Dear Joris, dear Darcy,



 one of my collaborators had problem on Mac with python. On his machine the 
PATH would not see the "right" instance of the Python interpreter. I think it 
would be nice to explain in the Help for Python how to customize the 
(python-command) call. And/or add a user preference to set from the Preference 
dialog the path to the python interpreter.



In general one would like to have mechanisms to override our "smart" choices 
with respect to where to find plugins. 



Max





Begin forwarded message:



From: Massimiliano Gubinelli <mailto:gubine...@iam.uni-bonn.de>

Subject: Re: Texmacs question

Date: 11. December 2020 at 13:55:59 CET

To: Nicolas Perkowski <mailto:perkow...@math.fu-berlin.de>



One possibility is that TeXmacs is started when the system PATH is still not 
appropriate to reach the Anaconda installed python.



You can test this hypothesis by openin a shell session inside TeXmacs and then 
try to do `which python3`.



If this is the case (that TeXmacs do not see the right python) then is 
trickier. There is yet no easy way to customize the python path,



you can try the following:



open a scheme session inside texmacs and do the command



(define (python-command) "/path/to/python")



where you put the path you want, e.g. "/usr/local/bin/python3" or whatever, to 
reach the Anaconda's python.



Then try to open a Python session. This should work but will stop to work as 
soon as you quit TeXmacs.



One possibility is to put the command in 



$HOME/.TeXmacs/progs/my-init-texmacs.scm



where $HOME points to your home directory.



Best



Max







On 11. Dec 2020, at 13:18, Nicolas Perkowski 
<mailto:perkow...@math.fu-berlin.de> wrote:



Hi Max,



thanks. When I type python or python3 in the terminal, it always opens the good 
version (managed by Anaconda).



The commands „which python“ or „which python3“ also give the good version 
(Anaconda).



„which pip3“ gave another version, probably the system Python3. But I changed 
that now with „pip install conda“ and now also „which pip3“ and „which pip“ 
list the good version.



But Texmacs still refuses to call the Anaconda Python3. There should be a 
possibility to tell it to use that one. Alternatively, thanks to your comment I 
inderstand that probably I could also reinstall Numpy and so for the system 
Python, but this seems like a hack…



Best,

Nicolas



Am 11.12.2020 um 09:59 schrieb Massimiliano Gubinelli 
<mailto:gubine...@iam.uni-bonn.de>:



Dear Nicolas,

 I've also used some Python in my lecture, is quite cool indeed. You find my 
scripts here, for example:



https://www.iam.uni-bonn.de/fileadmin/user_upload/gubinelli/einf-wahr-ws2021/wt-ws2120-script-13.pdf



The problem is that Python2 is somehow "deprecated" (by Python people) and we 
decided to move to Python3, so TeXmacs will look for it. On my system if I 
write python3 on the shell I can use this one. To install packages probably you 
have to use pip3 instead of pip. I have here:



Last login: Thu Dec 10 15:38:31 on ttys003

mgubi@Ulrike src % which pip3

/usr/local/bin/pip3

mgubi@Ulrike src % which python3

/usr/local/bin/python3

mgubi@Ulrike src % 







The short answer: TeXmacs call Python via "python3". To check where it is on 
your system, it should be enough to open a shell and type "which python3". This 
is the system used.



Let me know if you manage to solve the problem.



HTH,

Max









On 11. Dec 2020, at 08:21, Nicolas Perkowski 
<mailto:perkow...@math.fu-berlin.de> wrote:



Dear Max,

I am teaching in Texmacs this semester, and sometimes it would be quite cool to 
run small live Python scripts. So I tried the Python plugin, but it uses a 
weird Python version and therefore does not find Numpy and Matplotlib. My 
system version is Python 2.something, and through Anaconda I have 3.7.4, and 
this version also starts when I type „python" in the terminal. Texmacs opens 
Python 3.7.3, I don’t know where it found that one. The Clang versions are 
4.0.1 (Anaconda) and 11.0.3 (Texmacs). Do you know how to set Texmacs to find 
the packages?

Thanks for pointing out the book by Joris, I ordered it. Even the preview was 
quite helpful, I did not know about the command-shift-7 key combination for 
starting a multiline equation, and used \align* before which is more awkward.

And sorry for not showing up much for the MFO meeting, there is too much going 
on in the past weeks.

Best,
Nicolas






























_______________________________________________

Texmacs-dev mailing list

Texmacs-dev@gnu.org

https://lists.gnu.org/mailman/listinfo/texmacs-dev
_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Reply via email to