Problem to insert a Python session

I can’t insert a Python session within TeXmacs , I have the following message :
/Library/Developer/CommandLineTools/usr/bin/python3: can’t open file ‘/Users/
alexandre/.TeXmacs/plugins/tmpy/session/’: [Errno 2] No such file
or directory
I first wrote to Texmacs user mailing list , the thread of discussion is :
We will continue the discussion on the forum
Thank you to help me to fix the problem

Hi again :slight_smile:
I opened the Python plugin initialization file, init_python.scm, inside the plugins/python/progs/directory of the TeXmacs installation, and I found there is a definition which depends on whether you have a Python plugin directory in your TeXmacs home directory or not.
The error message you received makes me think that you have a /Users/alexandre/.TeXmacs/plugins/tmpy
directory, which though does not contain all of the files that it should contain, and you might have as well the /plugins/tmpy/ in the TeXmacs installation directory which according to the information that you posted on the mailing list is Applications/
Given this, I would try removing the /Users/alexandre/.TeXmacs/plugins/tmpy (maybe making a copy somewhere else if you want to preserve its contents) and see if without this directory the Python plugin works.

1 Like

Thank you again to help me:)
I removed the file /Users/alexandre/.TeXmacs/plugins/tmpy and I tried again to insert a Python session within TeXmacs but it is always the same message :
/Library/Developer/CommandLineTools/usr/bin/python3: can’t open file ‘/Users/alexandre/.TeXmacs/plugins/tmpy/session/’: [Errno 2] No such file or directory
Busy …

Could you please do from the menu Tools->Update->Plugins a few times (four or five), then exit TeXmacs, open TeXmacs and then try again? It seems to me that sometimes TeXmacs needs a bit of time to detect that plugins have changed

it is done but I have always the same problem.

Let’s then try another way.
Could you please copy paste and execute the following two commands, one per line, in a TeXmacs Scheme session (from the menu Insert->Session->Scheme, first item in Insert->Session):



(url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy")

What do you get?

Hi again :slight_smile:
I got : #:1:30: end of file in string constant
for the first command
and : #:1:49: end of file in string constant
for the second one
I don’t know scheme at all so I am unable to understand the responses

You should type double quote manually. There’s something wrong with coding system in webpage. Also these two:

(getenv "TEXMACS_PATH")
(url-exists? "$TEXMACS_PATH/plugins/tmpy")

Execute them one by one.

Thank you , I didn’t notice there was a pb with double quote
Finally I got :

For the commands of @sharkc?

Which TeXmacs version and macOS version are you using?

Another option is to use Edit -> Paste from -> Verbatim

Mac Version : Mac OS Big Sur 11.6.8 and
Texmacs version : TeXmacs-2.1.1.dmg for MacOS 10.10 and later.

If so, could you then check if the folder

exists? If it does not exist, it means that your TeXmacs installation has been corrupted.

I checked :
/Applications/ exists
/Applications/ doesn’t exist
I checked and I don’t have the folder tmpy at this address

IMHO if plugins/tmpy does not exist it makes sense to reinstall TeXmacs (perhaps downloading it again from and then check if the tmpy folder is there.
Before doing that it is still interesting to see the output of the commands



(url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy")

(in a Scheme session).

I got :
“/Users/alexandre/.TeXmacs” for the first command
#t for the second one

Seems like both your installation of TeXmacs and the directory storing user preferences and modifications (TEXMACS_HOME_PATH) are corrupted. My advice would be to uninstall and reinstall TeXmacs and move the directory “/Users/alexandre/.TeXmacs” to some backup location.

I uninstalled and reinstalled and I have exactly the same messages :

When I want to insert a Python session :
/Library/Developer/CommandLineTools/usr/bin/python3: can’t open file ‘/Users/alexandre/.TeXmacs/plugins/tmpy/session/’: [Errno 2] No such file or directory

In a scheme session :
(url-exists? “$TEXMACS_HOME_PATH/plugins/tmpy”)

This time , the directory : /Applications/ exists and contains some files and other directory

This is completely as expected. As I mentioned above, two directories have been corrupted and reinstalling only fixes one of them. To fix the other one, you need to move your /Users/alexandre/.TeXmacs folder, or delete the plugins/tmpy/ folder within it.