How install numpy in TeXmacs

Hi comunity, I installed python of the windows store and it works great in TeXmacs. Now I want to work with matrixs, so I need use the numpy package. But I don’t know how install it in TeXmacs.
Do you know how can I do it?

PD: I love TeXmacs and I think TeXmacs is the text editor of future :grin:

Welcome @MillerSilva!

TeXmacs uses your system’s Python, so if your Python can use Numpy, so can TeXmacs. Follow the general installation instructions and it should work:

Make sure to use the same method as the one you used to install Python.

1 Like

Does the Windows Store Python come with pip? In that case you could try to do ‘pip install numpy’ on the command line.

I had installed Python (from oficial Python page web) from before I installed TeXmacs, but TeXmacs was not recognize it. So I investigated and found a post where it said that it must install Python from Windows Store (Microsoft Store). So I thus I did it and it worked, TeXmacs recognized Python.

Now, I don´t know how to install Numpy. I share with you these imagens where It can see my attemps.

I tried it, but no works. :slightly_frowning_face:

This is not a problem with TeXmacs, itself. Maybe you can check here
as @jeroen said. Be aware that if you have multiple python installations on your machine you could have numpy installed in one but not in the other. Also check which is the one TeXmacs is using when you open a session (although I’m not sure how to do this on Windows).

1 Like

I notice from your screenshot that you entered pip into Python. The pip command needs to be run on the system command line, not inside Python. As "mgubi noted, though, you need to make sure you use the “right” pip. It’s probably safer to uninstall the Python installations you don’t intend to use.

1 Like

You can open a terminal and do

pip install numpy

as others have suggested, but if there is more than one Python in your system it is possible that you will install numpy for a Python that is not “seen” by TeXmacs.

To be sure that you are using the “right” pip, one possibility is going with PowerShell to the directory where the interpreter is, then run the pip that is contained there. In your screenshot of the terminal it is in the upper bar (I am assuming TeXmacs “sees” the Python installed with the Windows Store):

C:\Program Files\WindowsApps\PythonSoftwareFoundation ...

you can either copy it from there or get it from the TeXmacs Python session (if you run these commands from within the Python session in TeXmacs, then the output is the Python seen by TeXmacs) with

import sys

which should give in output the same directory that you see in that screenshot.

After that open PowerShell, cd to the folder you found, list the files with ls—you should find both python.exe and pip.exe—and then do

./pip install numpy

with the dot and the slash before pip (this will run the pip in that directory even if there is another pip installed elsewhere in your system).

Now you should be able to use numpy in a Python session in TeXmacs.


Thank you Pireddag. Now numpy works in Texmacs for me.

Regarding Python path …
I know this post is more targeted to Windows but for those who are using Ubuntu (20.04 for me) and Anaconda python distribution you may have to launch texmacs from the command line to be able to have all the environment variables of your anaconda python installation taken into account.

That’s how it works for me at least.

1 Like

Hi @pireddag, indeed the python that my TeXmacs recognizes is the one from Windows Store. I followed the steps that you said and it worked fine! Thank you for your very detailed aswer. :smiley:

I share with all you screenshots of the process I did.


On GNU/Linux or macOS, pyenv is a good choice to manage python virtual environments.

For windows, the pyenv plugin below is not tested. It should work with little changes on the scheme file.

Enhanced Python Plugin with pyenv Support for GNU TeXmacs - Community - GNU TeXmacs Forum

What changes it should be made?