-1

I'm just sruggling with importing modules from nested packages in Python.

After execute command in project root directory:

$ nosetests

Unfortunatelly, i'm still getting logs like this:

======================================================================
ERROR: Failure: ImportError (No module named io_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/user/dev/ease-ci/easeci-core/tests/lib/io/test_io_facade.py", line 4, in <module>
    from lib.io.io_file import file_load, File, file_exist, file_save, file_delete, file_change
ImportError: No module named io_file

And more and more errors like that. Can someone tell me something help me to resolve my issue? Thanks.

Project structure

Pycharm put me in error, because if I run test by green arrow, everything is ok. enter image description here

Karol
  • 51
  • 6

1 Answers1

0

I'm guessing that you are trying to install a library without pip installed because you used pycharm in a weird way. Try adding a path to the library which you have to download and then run the import within the code. Cheers!

import tensorflow as tf

https://www.jetbrains.com/help/pycharm/absolute-path-variables.html

Noah
  • 430
  • 1
  • 4
  • 21