Kismuz / btgym

Scalable, event-driven, deep-learning-friendly backtesting library
https://kismuz.github.io/btgym/
GNU Lesser General Public License v3.0
985 stars 260 forks source link

FileNotFoundError #43

Closed sharpwood closed 6 years ago

sharpwood commented 6 years ago

Use this template when reporting bugs, errors or unexpected behaviour. Override for general questions, feature requests, proposals etc.

Running environment:

Manjaro Linux Anaconda 5.1 Python 3.6 Jupyter Notebook

Files or part of package has been run:

atari_a3c

screenshot_20180330_160344

Kismuz commented 6 years ago

@sharpwood, thanks for pointing that out; corrected, update, should run ok.

sharpwood commented 6 years ago

Unfortunately, I updated and reinstalled it, but I still had that mistake.

[2018-03-31 10:55:34.071209] INFO: LauncherShell: Random seed: 0 </home/liguodong/tmp/test_gym_a3c> already exists. Override[y/n]? y [2018-03-31 10:55:39.373812] NOTICE: LauncherShell: Files in </home/liguodong/tmp/test_gym_a3c> purged.


FileNotFoundError Traceback (most recent call last)

in () 43 root_random_seed=0, 44 purge_previous=1, # ask to override previously saved model and logs ---> 45 verbose=1 46 ) ~/Code/btgym-master/btgym/algorithms/launcher/base.py in __init__(self, env_config, cluster_config, policy_config, trainer_config, max_env_steps, root_random_seed, test_mode, purge_previous, log_level, verbose) 183 184 # Make cluster specification dict: --> 185 self.cluster_spec = self.make_cluster_spec(self.cluster_config) 186 187 # Configure workers: ~/Code/btgym-master/btgym/algorithms/launcher/base.py in make_cluster_spec(self, config) 260 261 for _ in range(config['num_ps']): --> 262 self.clear_port(port) 263 self.ports_to_use.append(port) 264 all_ps.append('{}:{}'.format(config['host'], port)) ~/Code/btgym-master/btgym/algorithms/launcher/base.py in clear_port(self, port_list) 283 284 for port in port_list: --> 285 p = psutil.Popen(['lsof', '-i:{}'.format(port), '-t'], stdout=PIPE, stderr=PIPE) 286 pid = p.communicate()[0].decode()[:-1] # retrieving PID 287 if pid is not '': /opt/anaconda/lib/python3.6/site-packages/psutil/__init__.py in __init__(self, *args, **kwargs) 1309 # spawned by subprocess.Popen terminates too quickly, see: 1310 # https://github.com/giampaolo/psutil/issues/193 -> 1311 self.__subproc = subprocess.Popen(*args, **kwargs) 1312 self._init(self.__subproc.pid, _ignore_nsp=True) 1313 /opt/anaconda/lib/python3.6/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) 707 c2pread, c2pwrite, 708 errread, errwrite, --> 709 restore_signals, start_new_session) 710 except: 711 # Cleanup if the child failed starting. /opt/anaconda/lib/python3.6/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) 1342 if errno_num == errno.ENOENT: 1343 err_msg += ': ' + repr(err_filename) -> 1344 raise child_exception_type(errno_num, err_msg, err_filename) 1345 raise child_exception_type(err_msg) 1346 FileNotFoundError: [Errno 2] No such file or directory: 'lsof': 'lsof'
Kismuz commented 6 years ago

Hmm, @sharpwood do you have lsof utility installed?

sharpwood commented 6 years ago

I install lsof and it works. Thanks mate.