rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.6k stars 254 forks source link

Python3.6 ModuleNotFoundError on Import #110

Closed n8henrie closed 6 years ago

n8henrie commented 6 years ago
$ python3 --version
Python 3.6.3
$ python3 -m pip freeze | grep line-profiler
line-profiler==2.1.1
$ python3 -c 'import line_profiler'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/line_profiler.py", line 68, in <module>
    class LineProfiler(CLineProfiler):
  File "/usr/local/lib/python3.6/site-packages/line_profiler.py", line 122, in LineProfiler
    import line_profiler_py35
ModuleNotFoundError: No module named 'line_profiler_py35'

Downgrading to 2.0 imports okay.

OSX 10.13.2

n8henrie commented 6 years ago

Well, I tried to do a bisect to locate the problem, but it won't work because an installation from a git checkout seems to work fine. However, an installation from PyPI is still giving me the above error with 2.1.1.

n8henrie commented 6 years ago

Doesn't look like that file made it into the tar archive.

$ wget https://pypi.python.org/packages/0f/8b/803471ca150d9247a18726f848f6633d301aba634ed013fd2645d8b16ce5/line_profiler-2.1.1.tar.gz#md5=b4a0d6e1bc11df7560b14870b3858bd8
$ tar xzf line_profiler-2.1.1.tar.gz
$ cd line_profiler-2.1.1/
$ ls
LICENSE.txt         PKG-INFO          _line_profiler.pyx      line_profiler.py  setup.py  timers.h
LICENSE_Python.txt  README.rst        kernprof.py             python25.pxd      tests     unset_trace.c
MANIFEST.in         _line_profiler.c  line_profiler.egg-info  setup.cfg         timers.c  unset_trace.h
caethan commented 6 years ago

Looks like it's a byproduct of the coroutine support we added - has an additional file that only gets imported in python 3.5 and up, and since I built with 2.7, didn't get added to the tarball. Thanks for the report, will get this fixed.

caethan commented 6 years ago

@n8henrie Can you try the 2.1.2 release I just pushed to PyPI?

n8henrie commented 6 years ago

2.1.2 seems to work like a charm, thanks for the quick attention!