texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Fwd: Texmacs question


From: Julien Frontisi
Subject: Re: [Texmacs-dev] Fwd: Texmacs question
Date: Sat, 12 Dec 2020 19:43:33 +0100

Hi to all !
I don't know if this could be of any help : I have tried many times to look for the path of TeXmacs used python, in order to add modules through pip. 
Until I realized I just had to start a shell session inside TeXmacs and call pip from there. (Instead of doing it from the Terminal). This way pip adds the modules to the right python, among the many installations in my MacOS. No need to know which it is.
That might be just obvious for most people here, but it took me a while to find out.
Hope this helps someone. 
Take care
Julien

Le 12 déc. 2020 à 00:34, Darcy Shen via Texmacs-dev <texmacs-dev@gnu.org> a écrit :

Currently, the mechanisms to override the choices are described in the README:
git clone git@github.com:texmacs/python.git $HOME/.TeXmacs/plugins/python

If one has problem cloning, he/she should use the https protocol for Git.

For the following plugins, this trick should work. The plugin under the TEXMACS_HOME_PATH will take precedence over the system one.

+ Octave
+ Maxima
+ tmpy powered plugins:
   + Graphviz
   + Asymptote
   + Gnuplot
   + Python
   + Tikz
   + ... 

This trick/convention is the most important one for plugin developers/maintains.

---- On Sat, 2020-12-12 02:03:20 Massimiliano Gubinelli <m.gubinelli@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 <gubinelli@iam.uni-bonn.de>
Subject: Re: Texmacs question
Date: 11. December 2020 at 13:55:59 CET
To: Nicolas Perkowski <perkowski@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 <perkowski@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 <gubinelli@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:


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 <perkowski@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 mailing list
Texmacs-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/texmacs-dev

reply via email to

[Prev in Thread] Current Thread [Next in Thread]