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 #122

Closed Vicentelles closed 5 years ago

Vicentelles commented 6 years ago

$ python3 --version Python 3.6.5 $ python3 -m pip freeze | grep line-profiler line-profiler==2.1.2

$ kernprof -l -v backProcessor.py Wrote profile results to backProcessor.py.lprof Timer unit: 1e-06 s

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/bin/kernprof", line 11, in load_entry_point('line-profiler==2.1.2', 'console_scripts', 'kernprof')() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kernprof.py", line 222, in main execfile(scriptfile, ns, ns) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kernprof.py", line 35, in execfile exec(compile(f.read(), filename, 'exec'), globals, locals) File "backProcessor.py", line 2, in from vrt.level1Processor import processLvl1, setLevelPrices ModuleNotFoundError: No module named 'vrt'

Installed from pip3

"vrt" is a folder, "vrt.level1Processor" is the module.

It is not being interpreted rightly

Please, I need to use the line profiler. It is very important for my project

caethan commented 5 years ago

Looks to me like a pythonpath issue - n.b. that kernprof doesn't automatically assume that the local directory is in your pythonpath.