473,382 Members | 1,247 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Python / Visum Error Message

Hi, if anyone can help me unscramble this exception report from Python I'd be hugely grateful. All I'm trying to do is carry out is call VISUM and carry a flow bundle. I think the problem may be with the Python installation rather than the script.

Many thanks,

Stephen

I've got the following code:
Expand|Select|Wrap|Line Numbers
  1. import VisumPy.helpers
  2. #from VisumPy.helpers import CreateVisum
  3.  
  4. Visum = VisumPy.helpers.CreateVisum(115)
  5. fileNames = ["Base06_AM_DS"]
  6.  
  7. for fileName in fileNames: 
  8.     Visum.LoadVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName)
  9.  
  10. #flow bundle execute and save matrix
  11.  
  12. fn = 119545498
  13. tn = 119545499
  14.  
  15. # UC1
  16. dseg = "UC1"
  17. filename = "Y:/07 Forecasting/10 Review of Highway Model/Test/AA16DS_AM_SLA1_NB_UC1_F.mtx"
  18. netElem = Visum.CreateNetElements()
  19. link = Visum.Net.Links.ItemByKey(fn, tn)
  20. netElem.add(link)
  21. fb = Visum.Net.DemandSegments.ItemByKey(dseg).FlowBundle
  22. fb.Execute(netElem)
  23. fb.Save(filename,"O") 
  24.  
  25. #   Visum.Procedures.Execute()
  26. Visum.SaveVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName) 
------------------------------------------

And then this is the error message I get:

File "C:\Python25\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py" , line 309, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File "C:\Python25\Lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File "C:\Python25\Lib\site-packages\Pythonwin\pywin\debugger\debugger.py", line 624, in run
exec cmd in globals, locals
File "Y:\07 Forecasting\10 Review of Highway Model\Test\Oa_Original_SLA.py", line 21, in <module>
netElem.add(link)
File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 454, in __getattr__
raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr)
AttributeError: '<win32com.gen_py.Visum Object Library 11.5.INetElements instance at 0x22624096>' object has no attribute 'add'
>>>
Jan 30 '12 #1
1 3745
Smygis
126 100+
I can't find documentation on this module so im not sure whats going on. (PTV.de? my german is not good enough to figure out if the site is relevant)

What you could do is open up a python window and run the program line by line until you get to
Expand|Select|Wrap|Line Numbers
  1. netElem = Visum.CreateNetElements()
And then run:
Expand|Select|Wrap|Line Numbers
  1. dir(netElem)
And see what happens. The error seems to be about it not having a .add(), and i suppose if it looks strange that module might be corrupt or something.
Feb 1 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ajikoe | last post by:
I found this error message when I import pylab. from pylab import * Error message: Microsoft Visual C++ Runtime Library Assertion failed! Program:c\python24\python.exe...
5
by: Madhu R. Vajrala | last post by:
Hello All, I am very new to Python, trying to install it from source (ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/python-2.3.3.tar.gz) on Sun Solaris-9 (SPARC). But getting the below error...
5
by: Jon Guyer | last post by:
>>> This is a fake line to confuse the stupid top-posting filter at gmane We have a rather complicated class that, under certain circumstances, knows that it cannot perform various arithmetic...
26
by: Christoph Zwerschke | last post by:
You will often hear that for reasons of fault minimization, you should use a programming language with strict typing: http://turing.une.edu.au/~comp284/Lectures/Lecture_18/lecture/node1.html I...
8
by: Claudio Grondi | last post by:
Here an example of what I mean (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte large file): Traceback (most recent call last): File "<pyshell#1>", line 1, in -toplevel-...
2
by: redefined.horizons | last post by:
I've written a few classes that I have been testing in IDLE. However, every time I make a change to the classes based on the testing I have to walk through all he steps of preparing the classes for...
1
by: Prof Rodney Coates | last post by:
Although I have been using Macs for a quarter of a century and was doing scientific programming in the '60's I am VERY new to Python on the Mac. I have been writing some very simple applications and...
0
by: Steve Holden | last post by:
Ahmed, Shakir wrote: The error is at line 317 of your script. . Are you using the ctypes library, or some other extension module? It may be that in invalid pointer is causing problems for the...
0
by: Keith Bailey | last post by:
Dear All, Any help on this would be hugely appreciated. I have had a Python programme written for me, but when I try to run it, I get the following error message: /*Traceback (most recent...
5
by: goldtech | last post by:
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.