Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: Question about the module named caffi.ca
From: Wang Xiaoqiang <xiaoqiang.wang@psi.ch>
To: <tech-talk@aps.anl.gov>
Date: Mon, 23 Oct 2017 09:56:11 +0200

I forgot to reply to the list.

Pyinstaller does not seem, as far as I have tested, to understand the C extensions inside a zipped EGG package. The workaround is to unpack the package manually.
$ cd /home/scratch/miniconda/lib/python2.7/site-packages/
$ unzip CaChannel-3.0.0-py2.7-linux-x86_64.egg
$ rm CaChannel-3.0.0-py2.7-linux-x86_64.egg CaChannel.pth CaChannel.egg-link

Or re-install the package using easy_install
$ easy_install --always-unzip CaChannel

Best
Xiaoqiang

On 10/21/2017 01:44 PM, lzf neu wrote:
Hi,


I use pyinstaller to compile the python script to exe file in centos7
system that contained the following line :

from CaChannel import ca, CaChannel


When executing the exe file and an error occured :


[user@localhost dist]$ ./1-ok
/tmp/_MEIxRN9gA/CaChannel/ca.py:13: RuntimeWarning: c extension is not
available, trying caffi as fallback
Traceback (most recent call last):
  File "1-ok.py", line 4, in <module>
  File
"/usr/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py",
line 396, in load_module
    exec(bytecode, module.__dict__)
  File "CaChannel/__init__.py", line 3, in <module>
  File
"/usr/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py",
line 396, in load_module
    exec(bytecode, module.__dict__)
  File "CaChannel/CaChannel.py", line 15, in <module>
  File
"/usr/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py",
line 396, in load_module
    exec(bytecode, module.__dict__)
  File "CaChannel/ca.py", line 14, in <module>
ImportError: No module named caffi.ca
[26510] Failed to execute script 1-ok


It seems I have to enter the absoult path of caffi.ca when using
pyinstaller.


I have installed the cachannel by using the command:

sudo easy_install cachannel


I have no idea what the path of caffi.ca is under centos7 system or
other methods to solve the problem.


Any help will be appreciated and thanks in advance!


Zhefu




References:
Question about the module named caffi.ca lzf neu

Navigate by Date:
Prev: Re: s7plc more than one 240-byte PDU Maurizio Montis
Next: Re: Online EPICS training Paul Sichta
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Question about the module named caffi.ca lzf neu
Next: Online EPICS training Stephen Molloy
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 23 Oct 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·