In the middle of the desert you can say anything you want

04 Mar 2020

Day 429

Python imports

Python ‘No module named’ error; ‘package’ is not a package - Stack Overflow TL;DR Beware of conflicting filenames.

I keep getting bitten by this - if I have a folder called something and inside it something called and want to import something from the folder, it will take something to mean instead of the folder.

Quoting the most helpful answer:

I was using the same name for both a sub-package (directory) and a module (file) within it.

For example I had this:

    /opt/mylib/myapi/        # gitignored file for user/pass
    /opt/mylib/myapi/              # base module, load creds and connect
    /opt/mylib/myapi/      # call and do work

The script ‘’ imports credentials from via this statement:

    from myapi.myapi_creds import my_user, my_pass

Testing the module '' resulted in this error:

    $ ./
    Traceback (most recent call last):
      File "./", line 12, in <module>
        from myapi.myapi_creds import my_user, my_pass
      File "/opt/mylib/myapi/", line 12, in <module>
        from myapi.myapi_creds import my_user, my_pass
    ModuleNotFoundError: No module named 'myapi.myapi_creds'; 'myapi' is not a package

The solution was to rename to so it’s name does not collide with the sub-package name.

Markdown code in quotes

Is there a way to put code blocks in block quotes? - Meta Stack Overflow TL;DR Code is indented four spaces, but inside a quote (>) they have to be indented five spaces.

English - dingbat

dingbat - Wiktionary - crazy person - typographical ornament (like arrows) - small device/gadget the correct term for which is forgotten/unknown

Scipy normality test

scipy.stats.normaltest — SciPy v1.4.1 Reference Guide - function returns amongst other things p-value that the sample comes from a normal distribution.

Meaning of buffer_size= in dataset.shuffle()

tensorflow - Meaning of buffer_size in , Dataset.prefetch and Dataset.shuffle - Stack Overflow

It affects how random the shuffle is. A buffer size of 1 would not shuffle at all, one bigger than the dataset would be perfect. It’s basically the size of the randomly created bucket from which we pick the next element.

Nel mezzo del deserto posso dire tutto quello che voglio.