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

Import but said: "ModuleNotFoundError: No module named 'filereader" #4

Closed
zychen423 opened this issue Oct 17, 2018 · 4 comments
Closed

Comments

@zychen423
Copy link

Hi, first of all, thanks for providing this tool. I find it by series of SO.

However, I cannot use it in my code. I said ModuleNotFoundError: No module named 'filereader when I tried to import it. The whole ipython looks like:

$ :~ ipython3
Python 3.6.3 (default, Oct  6 2017, 00:00:00)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import bigjson
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-dc600f1cd09e> in <module>()
----> 1 import bigjson

/usr/local/lib/python3.6/dist-packages/bigjson-1.0-py3.6.egg/bigjson/__init__.py in <module>()
----> 1 from filereader import FileReader
      2
      3
      4 def load(file):
      5     reader = FileReader(file)

ModuleNotFoundError: No module named 'filereader'

I install this module by

$:~ cd bigjson
$:~/bigjson sudo python3.6 setup.py install

Is there anything wrong with my installation?

@mmmilja
Copy link

mmmilja commented Dec 17, 2018

Hi all,

I am having the same issue as zychen423, I am getting the "ModuleNotFoundError: No module named 'filereader'" error. I can see that filereader.py does exist in the bigjson folder of the GitHub zip I used to install the library.

Any ideas as to how to fix this error?

Edit: This seems to be a Python 2/3 issue: from .filereader import FileReader works. However, this leads to further errors: self.readbuf = self.readbuf[self.readbuf_read:] + self.file.read(read_amount) TypeError: must be str, not bytes

@zychen423
Copy link
Author

@mmmilja so does python2 work?

@mmmilja
Copy link

mmmilja commented Dec 22, 2018

@zychen423 I had some issues installing Py 2 so I could not try it. I have since moved on to a different solution (as the file I am trying to read actually contains one JSON object per line).

@henu
Copy link
Owner

henu commented Jul 4, 2019

Should be fixed now. Closing issue.

@henu henu closed this as completed Jul 4, 2019
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

3 participants