python packaging results in import error

I have a boost python generating a shared object to be used with python in /home/user/service/org/boost_py.so (This folder does not contain a __init__.py)

and /home/user/service is part of sys.path so when I need to use this ,just do

import org.boost_py   #works

Now I have added a pure python module in a different directory.

/home/user/service/pure_python/org/
                                  __init__.py
                                  tester.py

__init__.py contains

__import__('pkg_resources').declare_namespace(__name__)

Now when sys.path is

['/home/user/service/','/home/user/service/pure_python']

and I

import org.boost_py   #ImportError: No module named 'org.boost_py'

but I can import org.tester. How to import both org.tester and org.boost_py ? (I cannot change the location of either)

update: Found pth file with following contents in pure_python directory

import sys, types, os;
p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('org',));
ie = os.path.exists(os.path.join(p,'__init__.py'));
m = not ie and sys.modules.setdefault('org', types.ModuleType('org'));
mp = (m or []) and m.__dict__.setdefault('__path__',[]);
(p not in mp) and mp.append(p)

Answers


Apparently there is no file or directory boost_py in 'pure_python/org ', this produces the error.

If it exists please edit the question!

Alternatively, the path of the boost could be not in the path browser, then it just wont recognize the file.


Need Your Help

php and ffmpeg 500 internal server error

php ffmpeg

i'm trying to extract a single frame from a video file using the following php code:

How to hide keypad when editText is in focus

android android-edittext focus android-keypad

I want the editText box to be click-able so the user can scroll through the text, but I do not want the keyboard to appear.