This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ecosatto
Recipients ecosatto, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-04-24.22:07:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org>
In-reply-to
Content
I have an application with embedded python. When trying to import numpy, or any other module that was installed by pip, it fails with error 'ModuleNotFoundError("No module named ...")'. Yet, on the command line python, all works fine. The problem is not in the PATH, as only specific files (those with .<pyver-platform>.pyd extensions, e.g. .cp37-win_amd64.pyd) cannot be found. 

Example1: numpy

import numpy
>> ImportError("No module named 'numpy.core._multiarray_umath')

The line which fails is:
    from . import multiarray
The file it is trying to load:
C:\Program Files\Python37\Lib\site-packages\numpy\core_multiarray_umath.cp37-win_amd64.pyd


Example 2: cv2

import cv2
>> ModuleNotFoundError("No module named 'cv2.cv2'")
The line which fails is:
from .cv2 import *
The file it is trying to load:
C:\Program Files\Python37\Lib\site-packages\cv2\cv2.cp37-win_amd64.pyd
History
Date User Action Args
2019-04-24 22:07:39ecosattosetrecipients: + ecosatto, paul.moore, tim.golden, zach.ware, steve.dower
2019-04-24 22:07:39ecosattosetmessageid: <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org>
2019-04-24 22:07:39ecosattolinkissue36716 messages
2019-04-24 22:07:39ecosattocreate