Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running convert CLI #20

Open
JSB97 opened this issue Jan 29, 2021 · 1 comment
Open

Error running convert CLI #20

JSB97 opened this issue Jan 29, 2021 · 1 comment

Comments

@JSB97
Copy link

JSB97 commented Jan 29, 2021

  • jpxlab version: commit a9ca13f
  • Python version: 3.6.1
  • Operating System: darwin19

Description

i am trying to run the convert cli, as shown in this post.
Below is the error i get.

What I Did

$ cd jpxlab/jpxlab/
$ python cli.py convert ../downloads/StandardEquities_20210128.zip 

joblib.externals.loky.process_executor._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/externals/loky/process_executor.py", line 431, in _process_worker
    r = call_item()
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/externals/loky/process_executor.py", line 285, in __call__
    return self.fn(*self.args, **self.kwargs)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 595, in __call__
    return self.func(*args, **kwargs)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/parallel.py", line 263, in __call__
    for func, args, kwargs in self.items]
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/parallel.py", line 263, in <listcomp>
    for func, args, kwargs in self.items]
  File "/Users/mars/Documents/Data/JPX/FLEX/jpxlab/jpxlab/jpxlab.py", line 338, in fetch_and_convert
    _stream_convert(src, outpath, mode, date)
  File "/Users/mars/Documents/Data/JPX/FLEX/jpxlab/jpxlab/jpxlab.py", line 300, in _stream_convert
    zip_file = ZipFile(stream, allowZip64=True)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/zipfile.py", line 1100, in __init__
    self._RealGetContents()
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/zipfile.py", line 1168, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "cli.py", line 40, in <module>
    sys.exit(cmd())
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "cli.py", line 34, in convert
    Parallel(n_jobs=-1)(delayed(jpxlab.fetch_and_convert)(f) for f in files)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/parallel.py", line 1054, in __call__
    self.retrieve()
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/parallel.py", line 933, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result
    return future.result(timeout=timeout)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
zipfile.BadZipFile: File is not a zip file
@JSB97
Copy link
Author

JSB97 commented Jan 29, 2021

I ran the command again with a zip file I downloaded again.
It seems the program streamed the data without problem, but failed with the below error.

Any fixes you could suggest please?

$ python cli.py convert ../downloads/StandardEquities_20210128.zip 
Streaming: 0.00B [00:00, ?B/s]Fatal Python error: Py_Initialize: can't initialize sys standard streams
OSError: [Errno 9] Bad file descriptor

Current thread 0x0000000112eb1dc0 (most recent call first):
Streaming: 30.6GB [11:20, 45.0MB/s]
Traceback (most recent call last):
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/util.py", line 254, in _run_finalizers
    finalizer()
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/util.py", line 186, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/synchronize.py", line 89, in _cleanup
    unregister(name)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/semaphore_tracker.py", line 73, in unregister
    self._send('UNREGISTER', name)
  File "/Users/mars/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/semaphore_tracker.py", line 82, in _send
    nbytes = os.write(self._fd, msg)
BrokenPipeError: [Errno 32] Broken pipe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant