Questions tagged [external-calls]

Questions on calling external executables, not necessarily through MathLink.

70 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
18 votes
0 answers
513 views

Calling Sage functions from Mathematica

I recently found a very useful open-source math software called Sage, which provides many useful functions lacking in Mathematica. Since I'm more used to the Mathematica language instead of the ...
user avatar
  • 827
12 votes
0 answers
173 views

Mathematica is getting slow when repeatedly calling an external program

I found a strange phenomenon that Mathematica is getting slow when I repeatedly called an external program by using ReadList. For example, the following code will display a significant increase of CPU ...
user avatar
9 votes
0 answers
339 views

Failed to start python external session

I use Wolfram Mathematica 12 on Windows 10. Whey I try to register external evaluator RegisterExternalEvaluator["Python", "C:\\Python27\\python.exe"] it fails ...
user avatar
  • 91
9 votes
0 answers
316 views

Text fields in PDF Export

I am trying to implement a way in Mathematica to export graphics to PDF and then use Inkscape from within Mathematica to post process the resulting output with the pdf-latex export option in Inkscape. ...
user avatar
  • 663
8 votes
0 answers
321 views

Exporting Classify Models

Currently I have created a simple classifier to classify sentiment from a string of text (or a tweet). The code is very basic and looks something like this: ...
user avatar
  • 371
6 votes
0 answers
83 views

RunProcess not working on Windows (looking for information on this problem)

I am the author of the MaTeX package, and occasionally I receive support requests from users in e-mail. By now I believe I have ironed out virtually all bugs in MaTeX, and worked around most ...
user avatar
  • 225k
5 votes
0 answers
43 views

How to install node modules for external evaluation?

I was hoping for some extra clarity configuring additional modules for use in external evaluation, since there's no mention of this in the the nodejs workflow. It seems mathematica looks only at <...
user avatar
  • 30.5k
5 votes
0 answers
98 views

How to monitor progress with external language code?

I'm trying to figure out how to get tqdm (a python progress monitoring tool) to work with ExternalEvaluate and "ExternalLanguage"...
user avatar
  • 30.5k
5 votes
0 answers
85 views

Run computation in separate process and kill it after a time limit

I am looking for a solution to run a Mathematica calculation in a separate process (separate kernel) and cancel the computation after a given time. If it cannot be cancelled, then just kill that ...
user avatar
  • 225k
5 votes
0 answers
1k views

Can't register python in ExternalEvaluate

I had Anaconda 3 installed on my system and python registered with the following link: RegisterExternalEvaluator["Python","C:\\Users\\atfai\\Anaconda3\\python.exe"]...
user avatar
  • 8,337
4 votes
0 answers
81 views

Exporting a DimensionReducerFunction

I need to run my DimensionReducerFunction in a standalone fashion outside of MMA. That is, without calling into a kernel or through an APIFunction. For example, ...
user avatar
  • 30.5k
4 votes
0 answers
165 views

Can one combine Mathematica with bash script?

For example, I create a Mathematica nb file which can work on a set of parameter values or several files at once. It needs me to change the parameter after finishing computing one parameter. If I ...
user avatar
3 votes
0 answers
31 views

Is it possible to change the timeout for ExternalEvaluate?

I am using ExternalEvaluate in Mathematica 12.3.1.0 to do a computation with Jupyter and sagemath as kernel. Everything works fine if the computation finishes within 15 seconds, otherwise I get the ...
user avatar
3 votes
0 answers
80 views

Create "Python Code" cells using custom executable

In https://mathematica.stackexchange.com/a/155815/45020 it is explained how to run cells using a custom virtual environment. How can I quickly create a cell that is evaluated using this environment. ...
user avatar
  • 3,603
3 votes
0 answers
35 views

Can one preset credentials for ServiceConnect["Twitter", "New"] to allow wolframscript headless use?

Trying to run some wolframscript code from a server, is it possible to set ServiceConnect credentials in the environmental variables for example?
user avatar
  • 365
3 votes
0 answers
84 views

Why I can't link to Node.js in Mathematica

Suddenly I want to use ExternalEvaluate with Mathematica(for windows 10@12.0/12.1) and Node.js(for windows 10@12.14.1 and zeromq@5.2.0). Sure I have already read ...
user avatar
3 votes
0 answers
50 views

How to use ExternalEvaluate in ResourceFunction?

Are there any working examples or best practices for writing ResourceFunction that package or depend on external language code (and package dependencies) through <...
user avatar
  • 30.5k
3 votes
0 answers
174 views

Calling custom function from C++

I'm programming a project where I use multivariate symbolic polynomials. At some point I need to perform a PolynomialMod over a prime modulus, but the library GiNaC which I use works only over the ...
user avatar
  • 203
3 votes
0 answers
155 views

How to call an old build-in function in a new version of Mathematica?

In order to use the UnitStep of Mathematica 5.2, I have to install two different versions 5.2 and 11.3 at the same time because ...
user avatar
  • 663
3 votes
0 answers
217 views

Running latex via `RunProcess` or `ExternalEvaluate` fails in Ubuntu 18.04 due to `ZLIB_ 1.2.9' not found

I want to compile some latex documents programmatically. But one error is spoiling my whole pipeline that works in Windows. How to reproduce: Install texlive on ...
user avatar
  • 14.4k
3 votes
0 answers
150 views

`ExternalEvaluate` for NumPy: passing numpy arrays

As ExternalEvaluate for python has been introduced recently in V11.2, what is the best practice for passing data between Mathematica and NumPy? As by default, the ...
user avatar
  • 4,177
3 votes
0 answers
229 views

CCodeGenerate and calling external functions

Is it possible to use CCodeGenerate to generate code which calls functions from other C libraries? For example, I would like to do something like this: ...
user avatar
  • 181
2 votes
0 answers
79 views

How to login to Gmail using MailServerConnect[ ]?

I am trying to login to my Gmail account using the built-in function MailServerConnect[] and require help with the process: Connecting to the Gmail server (using <...
user avatar
  • 1,047
2 votes
0 answers
76 views

Store Mathematica results in an external rdbms

I want to store Mathematica results in an external rdbms, Postgres specifically. The Mathematica documentation talks a lot (eg in 'Relational Database Quick Start') about extracting data from external ...
user avatar
  • 21
2 votes
0 answers
45 views

Exporting packages containing "Python Code" cells

I created a notebook with Python code cells (evaluated using External Evaluate) as can be created by typing > at the beginning of a cell. (And choosing Python ...
user avatar
  • 3,603
2 votes
0 answers
20 views

Remove existing ServiceConnect authentication credentials

I am working on a project using the BingSearch ServiceConnect (ServiceConnect["BingSearch"]) and I would like to use a different authentication key then ...
user avatar
2 votes
0 answers
185 views

How to use Mathematica code in LaTeX files?

How can you use Mathematica code in LaTeX files? any similar to A random number is RNUMBER and the square of RNUMBER is RNUMBER^2 appearing numbers instead the capital letters (or Mathematica code) ...
user avatar
  • 3,091
2 votes
0 answers
437 views

Opening PDF file on a specific page

Trying to keep track of my Mathematica projects I usually include references to various PDF documents, websites, directories etc. such that I can open them from within the project. In this context I ...
user avatar
2 votes
0 answers
180 views

Using Python in Mathematica : RegisterExternalEvaluator doesn't work

I followed this tutorial https://reference.wolfram.com/language/tutorial/ConfigurePythonForExternalEvaluate.html, installed zmq, restarted mathematica and put this code: ...
user avatar
  • 1,973
2 votes
0 answers
72 views

RegisterExternalEvaluator with command line options

I'm trying to register NodeJS as an external evaluator in Mathematica 12.0. This works fine generally speaking. (i.e. following https://reference.wolfram.com/language/workflow/...
user avatar
2 votes
0 answers
512 views

Is there a API to scrape WhatsApp?

Is there an API to scrape WhatsApp messages into Mathematica? Either doing it directly in Wolfram Language or using some python API and WL's ExternalEvaluate. All ...
user avatar
  • 8,337
2 votes
0 answers
65 views

ExternalEvaluate Python print is printing an extra empty cell with newline

When using print command in ExternalEvaluate["Python","print(1+1)"] or ExternalLanguage cell using >, there is always an extra ...
user avatar
  • 8,337
2 votes
0 answers
42 views

Create a ProcessObject for a process not made with StartProcess

I am launching and linking to Mathematica from an external process and would like to be able to create a ProcessObject for the launching process that will support <...
user avatar
  • 45.5k
2 votes
0 answers
26 views

How to use "Segment" in "GoogleAnalytics" service connection?

I‘m trying to make a GA request using the "Segment" parameter but as the the Wolfram Documentation states, Segment ID must be an integer: segments the data returned for your request; accepts an ...
user avatar
  • 141
2 votes
0 answers
370 views

How to run external program in graphical mode

I can run system command from Mathematica with Run["command"]. But if the command starts windowed application then nothing ...
user avatar
  • 295
2 votes
0 answers
233 views

How to use Pandoc in Mathematica 10?

Pandoc can convert documents in markdown etc. to HTML etc.. It can be worked well in cmd or bat file. I want to use Pandoc in Mathematica 10 on Windows7, but it doesn't work. Method 1: ...
user avatar
  • 336
2 votes
0 answers
172 views

How to use RunProcess to run python interpreter

In a related question How to use RunProcess to import external function? @taliesin provides a very nice answer illustrating using RunProcess to launch a GO http server. Has anyone, or does anyone ...
user avatar
  • 733
2 votes
0 answers
103 views

Is it possible to pipe the output of EvaluationMonitor to Excel?

I have an EvaluationMonitor setup to capture the points processed by NIntegrate. This is a case where the same function, integrated over the same region in cartesian coordinates yields a dramatically ...
user avatar
  • 2,065
2 votes
0 answers
149 views

Attempt to Run["inkskape"] fails

I wrote a little script to convert various graphics files (.ps, .eps, .pdf) to the raster ones (.png). Export[out, Import[in], ImageSize -> size] fails for some ...
user avatar
  • 183
1 vote
0 answers
62 views

Using a Remote Kernel

I'm trying to connect the front end on Mac OS (version 13.0) use a remote (also 13.0) kernel running on an Ubuntu machine. I've followed the basic steps here (https://reference.wolfram.com/language/...
user avatar
1 vote
0 answers
33 views

Creating a function, saving it in a file, and calling it in another file

I'd like to know how to wrap up a function in a file an then how to call it in another file. For example, I've the following long piece of code which is used to create the function PlotExplorer. I ...
user avatar
1 vote
0 answers
48 views

Open a Terminal by StartProcess and write commands to it does not work as expected

Probably my expecations are wrong: I want to open a terminal window on my Xubuntu 20.04 system. Then I want to issue the command tail -f ~/M to display the tail of ...
user avatar
1 vote
0 answers
55 views

Alternative for ExternalEvaluate in version <11.2

I have code which uses ExternalEvaluate. Specifically the format using "Command" and ...
user avatar
  • 3,603
1 vote
0 answers
52 views

Run a command which has a file parameter when the file path passed contains non-ASCII characters

I want to do run a Linux command from a Mathematica notebook. I see, that Mathematica and my Linux operating system use different character coding. The problem is that the directories and the file ...
user avatar
1 vote
0 answers
66 views

How to use conda environments in StartExternalSession?

I am trying to get a conda python environment to run in Mathematica under Windows. It includes the following packages (in case you want to reproduce): ...
user avatar
  • 967
1 vote
0 answers
44 views

Substitute for MathLink to integrate PARI with Mathematica?

How does one access MathLink with current version of Mathematica? I'm trying to integrate the "computer algebra system" PARI with Mathematica, as documented at https://pari.math.u-bordeaux....
user avatar
  • 11.3k
1 vote
0 answers
67 views

Problem with RunProcess

I'm trying to use the RunProcess function to run docker on Mac OS using Mathematica. But there is a problem: ...
user avatar
  • 11
1 vote
0 answers
81 views

How to call the function calculation result of Magma in MMA

Magma is a very useful abstract algebra calculation software.How to call the function calculation result of magma in MMA? ...
user avatar
1 vote
0 answers
36 views

Connect to running external session?

Is there some way to connect to an already running process in the same way that StartExternalSession starts a process?
user avatar
  • 30.5k
1 vote
0 answers
245 views

How can I efficiently call an external Python script that needs to run continuously?

I am writing a Mathematica program that tries to run 100+ Python programs, via StartProcess[], continuously. It seems to work when I run < 100 programs, but, at ...
user avatar
  • 1,397