mabl / PyPylon

An experimental python wrapper around the Basler Pylon 5 library
BSD 3-Clause "New" or "Revised" License
53 stars 34 forks source link

No module named 'pypylon.cython.factory' #35

Open robmarkcole opened 7 years ago

robmarkcole commented 7 years ago

I see this error, which is odd since the file appears to be there.

image

My install logs below look in order.


C:\Users\Lab\Documents\Basler\PyPylon>C:\ProgramData\Anaconda3\python setup.py i
nstall
running install
running bdist_egg
running egg_info
writing pypylon.egg-info\PKG-INFO
writing dependency_links to pypylon.egg-info\dependency_links.txt
writing top-level names to pypylon.egg-info\top_level.txt
reading manifest file 'pypylon.egg-info\SOURCES.txt'
writing manifest file 'pypylon.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
skipping 'cython\version.cpp' Cython extension (up-to-date)
building 'pypylon.cython.version' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\cython
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /
nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Basler\pylon 5\Development\i
nclude" -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include -IC:\Pro
gramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program File
s (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windo
ws Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NET
FXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared"
 "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86
)\Windows Kits\8.1\include\winrt" /EHsc /Tpcython\version.cpp /Fobuild\temp.win-
amd64-3.6\Release\cython\version.obj
version.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /n
ologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:
C:\Program Files\Basler\pylon 5\Runtime\x64" "/LIBPATH:C:\Program Files\Basler\p
ylon 5\Development\lib\x64" /LIBPATH:C:\ProgramData\Anaconda3\libs /LIBPATH:C:\P
rogramData\Anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Vi
sual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\
lib\10.0.10150.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSD
K\4.6\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\
um\x64" GCBase_MD_VC120_v3_0_Basler_pylon_v5_0.lib GenApi_MD_VC120_v3_0_Basler_p
ylon_v5_0.lib PylonBase_MD_VC120_v5_0.lib PylonC_MD_VC120.lib PylonGUI_MD_VC120_
v5_0.lib PylonUtility_MD_VC120_v5_0.lib /EXPORT:PyInit_version build\temp.win-am
d64-3.6\Release\cython\version.obj /OUT:build\lib.win-amd64-3.6\pypylon\cython\v
ersion.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\cython\versio
n.cp36-win_amd64.lib
version.obj : warning LNK4197: export 'PyInit_version' specified multiple times;
 using first specification
   Creating library build\temp.win-amd64-3.6\Release\cython\version.cp36-win_amd
64.lib and object build\temp.win-amd64-3.6\Release\cython\version.cp36-win_amd64
.exp
Generating code
Finished generating code
cythoning cython/factory.pyx to cython\factory.cpp
building 'pypylon.cython.factory' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /
nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Basler\pylon 5\Development\i
nclude" -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include -IC:\Pro
gramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program File
s (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windo
ws Kits\10\include\10.0.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NET
FXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared"
 "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86
)\Windows Kits\8.1\include\winrt" /EHsc /Tpcython\factory.cpp /Fobuild\temp.win-
amd64-3.6\Release\cython\factory.obj
factory.cpp
c:\programdata\anaconda3\lib\site-packages\numpy\core\include\numpy\npy_1_7_depr
ecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defin
ing NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
C:\Program Files\Basler\pylon 5\Development\include\GenApi/GenApiLinkage.h(40):
warning C4081: expected ')'; found '('
C:\Program Files\Basler\pylon 5\Development\include\GenApi/GenApiLinkage.h(41):
warning C4081: expected ')'; found '('
C:\Program Files\Basler\pylon 5\Development\include\pylon/PylonUtilityIncludes.h
(44): warning C4081: expected ')'; found '('
C:\Program Files\Basler\pylon 5\Development\include\pylon/PylonIncludes.h(141):
warning C4081: expected ')'; found '('
cython\factory.cpp(3493): warning C4800: 'int': forcing value to bool 'true' or
'false' (performance warning)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /n
ologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:
C:\Program Files\Basler\pylon 5\Runtime\x64" "/LIBPATH:C:\Program Files\Basler\p
ylon 5\Development\lib\x64" /LIBPATH:C:\ProgramData\Anaconda3\libs /LIBPATH:C:\P
rogramData\Anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Vi
sual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\
lib\10.0.10150.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSD
K\4.6\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\
um\x64" GCBase_MD_VC120_v3_0_Basler_pylon_v5_0.lib GenApi_MD_VC120_v3_0_Basler_p
ylon_v5_0.lib PylonBase_MD_VC120_v5_0.lib PylonC_MD_VC120.lib PylonGUI_MD_VC120_
v5_0.lib PylonUtility_MD_VC120_v5_0.lib /EXPORT:PyInit_factory build\temp.win-am
d64-3.6\Release\cython\factory.obj /OUT:build\lib.win-amd64-3.6\pypylon\cython\f
actory.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\cython\factor
y.cp36-win_amd64.lib
factory.obj : warning LNK4197: export 'PyInit_factory' specified multiple times;
 using first specification
   Creating library build\temp.win-amd64-3.6\Release\cython\factory.cp36-win_amd
64.lib and object build\temp.win-amd64-3.6\Release\cython\factory.cp36-win_amd64
.exp
Generating code
Finished generating code
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\pypylon
creating build\bdist.win-amd64\egg\pypylon\cython
copying build\lib.win-amd64-3.6\pypylon\cython\factory.cp36-win_amd64.pyd -> bui
ld\bdist.win-amd64\egg\pypylon\cython
copying build\lib.win-amd64-3.6\pypylon\cython\version.cp36-win_amd64.pyd -> bui
ld\bdist.win-amd64\egg\pypylon\cython
copying build\lib.win-amd64-3.6\pypylon\cython\__init__.py -> build\bdist.win-am
d64\egg\pypylon\cython
copying build\lib.win-amd64-3.6\pypylon\__init__.py -> build\bdist.win-amd64\egg
\pypylon
byte-compiling build\bdist.win-amd64\egg\pypylon\cython\__init__.py to __init__.
cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\pypylon\__init__.py to __init__.cpython
-36.pyc
creating stub loader for pypylon\cython\version.cp36-win_amd64.pyd
creating stub loader for pypylon\cython\factory.cp36-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\pypylon\cython\version.py to version.cp
ython-36.pyc
byte-compiling build\bdist.win-amd64\egg\pypylon\cython\factory.py to factory.cp
ython-36.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying pypylon.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying pypylon.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pypylon.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-I
NFO
copying pypylon.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
pypylon.cython.__pycache__.factory.cpython-36: module references __file__
pypylon.cython.__pycache__.version.cpython-36: module references __file__
creating dist
creating 'dist\pypylon-0.0.1-py3.6-win-amd64.egg' and adding 'build\bdist.win-am
d64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing pypylon-0.0.1-py3.6-win-amd64.egg
creating c:\programdata\anaconda3\lib\site-packages\pypylon-0.0.1-py3.6-win-amd6
4.egg
Extracting pypylon-0.0.1-py3.6-win-amd64.egg to c:\programdata\anaconda3\lib\sit
e-packages
Adding pypylon 0.0.1 to easy-install.pth file

Installed c:\programdata\anaconda3\lib\site-packages\pypylon-0.0.1-py3.6-win-amd
64.egg
Processing dependencies for pypylon==0.0.1
Finished processing dependencies for pypylon==0.0.1
eudoxos commented 7 years ago

I am seeing the same error thing in Linux. I think the code needs to do relative import (these things are different between 2.x and 3.x), like

from .cython.factory import Factory

instead of

from cython.factory import Factory

Changing those by hand in init.py fixed the issue for me.

madhusudangr commented 7 years ago

@robmarkcole I think the error rises when you try to run the python console inside the same folder which has the pypylon source code. Try running it from a different folder. I was able to clear the issue, by running it from a different folder.

@eudoxos Yes, the relative import was the problem, it solved the issue for me.

robmarkcole commented 7 years ago

@eudoxos & @madhusudangr thanks for the input, however I don't see init.py, only init.py Where should init.py be? Cheers