Project

General

Profile

JEOL 3200

Added by Xing Meng over 10 years ago

Hi
We installed the packages for the control win7
python
import jeolcom
No module named comtypes.client

Xing


Replies (13)

RE: JEOL 3200 - Added by Anchi Cheng over 10 years ago

I just added comtypes installer as an requirement. Please bear with us. We ourselves have not installed on JEOL at NRAMM. We are learning what is needed with you.

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

import jeolcom OK
t =jeolcom.Jeol()

import jeolcom
t =jeolcom.Jeol()

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "jeolcom.py", line 90, in init
tem.TEM.__init__(self)
File "tem.py", line 90, in init
self.config_name = config.getNameByClass(self.__class__)
File "config.py", line 112, in getNameByClass
conf = getConfigured()
File "config.py", line 96, in getConfigured
parse()
File "config.py", line 62, in parse
cls = getattr(mod, clsname)
AttributeError: 'module' object has no attribute 'TietzFC416'

RE: JEOL 3200 - Added by Anchi Cheng over 10 years ago

Also don't forget to replace safearray with the one in pyscope.

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

I did the replacement
But

import jeolcom

t =jeolcom.Jeol()

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "jeolcom.py", line 90, in init
tem.TEM.__init__(self)
File "tem.py", line 90, in init
self.config_name = config.getNameByClass(self.__class__)
File "config.py", line 112, in getNameByClass
conf = getConfigured()
File "config.py", line 96, in getConfigured
parse()
File "config.py", line 62, in parse
cls = getattr(mod, clsname)
AttributeError: 'module' object has no attribute 'TietzFC416'

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

run python updatecom.py
C:\Python27\Lib\site-packages\pyscope>python updatecom.py
Generating .py files from type libraries...
initializing TEM Scripting
Traceback (most recent call last):
File "updatecom.py", line 54, in <module>
run()
File "updatecom.py", line 50, in run
makeFile(desc)
File "updatecom.py", line 29, in makeFile
print 'Error, cannot find typelib for "%s"' % descs
TypeError: not all arguments converted during string formatting

RE: JEOL 3200 - Added by Anchi Cheng over 10 years ago

The version of updatecom.py you have has a bug in printing error. Replace it with this one:

http://emg.nysbc.org/projects/leginon/repository/revisions/18314/entry/trunk/pyscope/updatecom.py

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

Hi Anchi
python updatecom.py

File "updatecom.py", line 1
&lt;!DOCTYPE html&gt;
^
SyntaxError: invalid syntax

C:\Python27\Lib\site-packages\pyscope>

but

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

t =jeolcom.Jeol()
t.getMagnification()

works\Thanks
updatecom.py still failed

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

C:\Python27\Lib\site-packages\pyscope>python updatecom.py
Generating .py files from type libraries...
initializing TEM Scripting
Traceback (most recent call last):
File "updatecom.py", line 54, in <module>
run()
File "updatecom.py", line 50, in run
makeFile(desc)
File "updatecom.py", line 29, in makeFile
print 'Error, cannot find typelib for "%s"' % descs
TypeError: not all arguments converted during string formatting

RE: JEOL 3200 - Added by Anchi Cheng over 10 years ago

Try deleting all other com modules looked for by updatecom to avoid the error printing bug above until I can fix it.

In updatecom.py look for

info = [
  (('TEM Scripting','Tecnai Scripting'), 'TEM Scripting'),
  (('TOMMoniker 1.0 Type Library',), 'TOM Moniker'),
  (('Low Dose Server Library',), 'Tecnai Low Dose Kit'),
  (('adaExp Library',), 'Tecnai Exposure Adaptor'),
  (('TecnaiCCD 1.0 Type Library',), 'Gatan CCD Camera'),
  (('CAMC4 1.0 Type Library',), 'Tietz CCD Camera'),
  (('ES Vision 3.1 Type Library','ES Vision 3.0 Type Library'), 'TIA CCD Camera'),
]

and leaves only

info = [
  (('CAMC4 1.0 Type Library',), 'Tietz CCD Camera'),
]

RE: JEOL 3200 - Added by Anchi Cheng over 10 years ago

I merged the fix for the bad error message printing to 3.0. You can either use svn update to get it or replace it with this download directly.

http://emg.nysbc.org/projects/leginon/repository/raw/branches/myami-3.0/pyscope/updatecom.py

RE: JEOL 3200 - Added by Xing Meng over 10 years ago

Anchi
Thanks
I stopped doing Tietz that is just for test

I did installation in K2 win7 that is online, making setting comtypes difficult
I did installing win32 on it
import jeolcom test ok
import pyscope.dmsem test ok

this means leginon can find both JEOL and K2?

but
python updatecom.py
C:\Python27\Lib\site-packages\pyscope>python updatecom.py
Generating .py files from type libraries...
initializing TEM Scripting
Traceback (most recent call last):
File "updatecom.py", line 54, in <module>
run()
File "updatecom.py", line 50, in run
makeFile(desc)
File "updatecom.py", line 29, in makeFile
print 'Error, cannot find typelib for "%s"' % descs
TypeError: not all arguments converted during string formatting

RE: JEOL 3200 - Added by Anchi Cheng over 10 years ago

Since this computer has only Jeol and K2 (communicated thru SEMCCD), you don't need to run updatecom.py

Regarding updatecom.py, you probably didn't put my new file at the right place (in C:\Python27\Lib\site-packages\pyscope). The error message you post suggests that it is still the old file.

It is also possible that the old compiled file (updatecom.pyc) in C:\Python27\Lib\site-packages\pyscope was loaded by python. Sometimes, it forget to recompile the script so that the new file is not read. You can remove updatecom.pyc manually before trying again if you want to test it. However, as I said above, you shouldn't have to run updatecom.py if tests for both tests are successful already.

    (1-13/13)