Configuring Python setup.py

Viewed 139

I have created a project called NumerMP a few days ago which will provide multi-threaded numerical methods (using OpenMP library), and will provide python API for end users (using wrapper functons-f2py). I had to use f2py smart way, due to customizing fortran signature files (.pyf) before generating extension modules. To do so I ran commands below:

  • python -m numpy.f2py trial_file.f90 -m module_name -h trial_file.pyf
  • python -m numpy.f2py -c --f90flags=’-fopenmp’ -lgomp trial_file.pyf trial_file.f90

Then I tested generated extension modules (.so files) inside package itself and they worked correctly, Then I built whole project and uploaded to test pypi and installed it using pip, But I got an ImportError.

The structure of the package is as follows: enter image description here

When I run each sample wrapper function inside package itself, as you can see they run correctly.
But I got error below when I used it inside other project: enter image description here

1 Answers

Update

You have some sibling submodules:

module
|- first
|   |- functions.py
|- second
|   |- wrapper.py

Then in second/wrappdr.py:

from ..first import functions

functions.function1()
Related