MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia

Home Page:https://astroautomata.com/PySR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No such file or directory: 'julia': 'julia'

eladmw opened this issue · comments


FileNotFoundError Traceback (most recent call last)
in
----> 1 equations = pysr(hash_characters, target.values, niterations=5)

/opt/conda/lib/python3.7/site-packages/pysr/sr.py in pysr(X, y, weights, binary_operators, unary_operators, procs, loss, populations, niterations, ncyclesperiteration, alpha, annealing, fractionReplaced, fractionReplacedHof, npop, parsimony, migration, hofMigration, shouldOptimizeConstants, topn, weightAddNode, weightInsertNode, weightDeleteNode, weightDoNothing, weightMutateConstant, weightMutateOperator, weightRandomize, weightSimplify, perturbationFactor, timeout, extra_sympy_mappings, equation_file, test, verbosity, progress, maxsize, fast_cycle, maxdepth, variable_names, batching, batchSize, select_k_features, warmupMaxsizeBy, constraints, useFrequency, tempdir, delete_tempfiles, julia_optimization, julia_project, user_input, update, temp_equation_file, output_jax_format, warmupMaxsize, nrestarts, optimizer_algorithm, optimizer_nrestarts, optimize_probability, optimizer_iterations)
344
345 _create_julia_files(**kwargs)
--> 346 _final_pysr_process(**kwargs)
347 _set_globals(**kwargs)
348

/opt/conda/lib/python3.7/site-packages/pysr/sr.py in _final_pysr_process(julia_optimization, runfile_filename, timeout, **kwargs)
374 if timeout is not None:
375 command = [f'timeout', f'{timeout}'] + command
--> 376 _cmd_runner(command, **kwargs)
377
378 def _cmd_runner(command, **kwargs):

/opt/conda/lib/python3.7/site-packages/pysr/sr.py in _cmd_runner(command, **kwargs)
379 if kwargs['verbosity'] > 0:
380 print("Running on", ' '.join(command))
--> 381 process = subprocess.Popen(command, stdout=subprocess.PIPE, bufsize=-1)
382 try:
383 while True:

/opt/conda/lib/python3.7/subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
798 c2pread, c2pwrite,
799 errread, errwrite,
--> 800 restore_signals, start_new_session)
801 except:
802 # Cleanup if the child failed starting.

/opt/conda/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
1549 if errno_num == errno.ENOENT:
1550 err_msg += ': ' + repr(err_filename)
-> 1551 raise child_exception_type(errno_num, err_msg, err_filename)
1552 raise child_exception_type(err_msg)
1553

FileNotFoundError: [Errno 2] No such file or directory: 'julia': 'julia'

Do you have Julia installed?

It looks like that's probably the problem, it hadn't occurred to me

No worries. I should add a better error message for that.