import module problem

Asked by Rinaldi Giuseppe on 2012-03-22

Hi all,

I want to start running simulation on a new more powerful machine.
So I installed on it "Yade 0.50" from packages (For stable releases) but when I run it I get this:

Welcome to Yade 0.50
TCP python prompt on localhost:9000, auth cookie `keycas'
TCP info provider on localhost:21000
Running script generation.py
Traceback (most recent call last):
  File "/usr/bin/yade", line 112, in <module>
    execfile(args[0])
  File "generation.py", line 49, in <module>
    from yade import pack,log,params,timing
ImportError: cannot import name params
[[ ^L clears screen, ^U kills line. ]]

On my old laptop I have "yade-daily" and this script works without any problem.

what's the problem?

Thanks all

Giuseppe

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Anton Gladky
Solved:
2012-03-28
Last query:
2012-03-28
Last reply:
2012-03-23
Jérôme Duriez (jduriez) said : #1

Hello,

The problem is probably that "params" modul exists in "yade-daily" but not in "Yade 0.50".

Try without importing this (remove "params" the line "from yade import...")

Anton Gladky (gladky-anton) said : #2

Hi Rinaldi,

I would recommend you to install yade-stable package, it will bring
you version 0.70 and your script should probably work.

Anton

Rinaldi Giuseppe (ciosrin) said : #3

Thank you both for the quickly reply!

if I try to remove "params" I got a different strange error:

Welcome to Yade 0.50
TCP python prompt on localhost:9000, auth cookie `euysds'
TCP info provider on localhost:21000
Running script generationbu.py
WARN py/log.cpp:43 logSetLevel: Yade was compiled without log4cxx support. Setting log levels from python will have no effect (warn once).
Traceback (most recent call last):
  File "/usr/bin/yade", line 112, in <module>
    execfile(args[0])
  File "generationbu.py", line 99, in <module>
    O.cell.setBox(Vector3(dim,dim,dim)) # set size of the cell (rectangular)
AttributeError: 'Cell' object has no attribute 'setBox'
[[ ^L clears screen, ^U kills line. ]]

It's strange because if I run the same script on "yade-daily" it works.
tomorrow I try to install the stable package because probably I did something wrong during the installation.

I will let you know.

many thanks,

Giuseppe

Anton Gladky (gladky-anton) said : #4

0.50 version was released about 2 years ago. It is pretty old.

Anton

Rinaldi Giuseppe (ciosrin) said : #5

my professor wants me to install the same version that I have in my old computer in the new computer.

So I uninstalled "yade 0.5" and I installed daily-yade writing in the terminal:

sudo add-apt-repository ppa:yade-pkg/snapshots
sudo apt-get update
sudo apt-get install yade-daily

now I have no more that problem but if I run a script in which I load a file I get:

esskdb@esskdb:~/Desktop/giuseppe$ yade-daily simpleShear.py
Welcome to Yade 1+3053+27~lucid1, from 2012-03-22
TCP python prompt on localhost:9000, auth cookie `sadekc'
XMLRPC info provider on http://localhost:21000
Running script simpleShear.py
Traceback (most recent call last):
  File "/usr/bin/yade-daily", line 182, in runScript
    execfile(script,globals())
  File "simpleShear.py", line 8, in <module>
    O.load('5000-100-oedom.yade.gz');
RuntimeError: unsupported version
[[ ^L clears screen, ^U kills line. F8 plot. ]]

what's the problem?
if you think that is better to use the "yade 0.7" version what I have to write on the terminal to install "yade-stable package 0.7"?

Thanks all

Giuseppe

Anton Gladky (gladky-anton) said : #6

You are trying to import the simulation, that you saved in 0.50 version.
Right? So in this case you should really use 0.50

Anton

Rinaldi Giuseppe (ciosrin) said : #7

I'm trying to import simulation I saved in daily-yade ("Yade 1+2978+27~oneiric1") and I'm trying to run it on daily-yade ("Yade 1+3053+27~lucid1").
they have different version of Ubuntu (11.10 in the old computer and 10.04.3 in the new computer)

But I installed daily-yade on both the computers.

Giuseppe

On 23/03/12 13:05, Anton Gladky wrote:
> Question #191412 on Yade changed:
> https://answers.launchpad.net/yade/+question/191412
>
> Anton Gladky proposed the following answer:
> You are trying to import the simulation, that you saved in 0.50 version.
> Right? So in this case you should really use 0.50
>
> Anton
>
On different machines, there can be conflicts even while using the same
version (I have some experience with that).

1. As Anton suggests, you should install the same version you used to
create your simulation.
2. You should also make sure that the simulation is saved as
"bla.xml.bz2" other than "bla.yade.gz" as this could avoid the error you
get now (just reload the test on your original machine and save it in
xml format).
3. Finally, if this still does not work, you should simply run the test
again on the new machine.

Chiara

On 23/03/12 13:30, Rinaldi Giuseppe wrote:
> Question #191412 on Yade changed:
> https://answers.launchpad.net/yade/+question/191412
>
> Rinaldi Giuseppe posted a new comment:
> I'm trying to import simulation I saved in daily-yade ("Yade 1+2978+27~oneiric1") and I'm trying to run it on daily-yade ("Yade 1+3053+27~lucid1").
> they have different version of Ubuntu (11.10 in the old computer and 10.04.3 in the new computer)
>
> But I installed daily-yade on both the computers.
See my reply. If the xml format is still not supported, you will have to
run the test once again.

Cheers.
Chiara
>
> Giuseppe
>

Anton Gladky (gladky-anton) said : #10

Hmm, it can be related to different versions of boost-serialization on
those Ubuntu versions (1.40 against 1.46).

Anton

Rinaldi Giuseppe (ciosrin) said : #11

If I run the test again on the new machine saving compressed file then I can load them.

but it could be useful if I can use the compressed files from the old computer on the new one.

so I will try with the xml file.

I will let you know.

Thanks again,

Giuseppe

Best Anton Gladky (gladky-anton) said : #12

> but it could be useful if I can use the compressed files from the old
> computer on the new one.

It is not yade-side, it is boost-side.
I would not recommend to use lucid. It is stable, but backporting on
so old systems becomes more and more complicated.

Anton

Rinaldi Giuseppe (ciosrin) said : #13

if I save and load file as "bla.xml.bz2" I get:

Welcome to Yade 1+3053+27~lucid1, from 2012-03-22
TCP python prompt on localhost:9000, auth cookie `ysecad'
XMLRPC info provider on http://localhost:21000
Running script simpleShear-xml.py
Traceback (most recent call last):
  File "/usr/bin/yade-daily", line 182, in runScript
    execfile(script,globals())
  File "simpleShear-xml.py", line 8, in <module>
    O.load('5000-100-oedometric.xml.bz2');
RuntimeError: stream error

So probably it is a problem on the boots-side.

thank you,

Giuseppe

Rinaldi Giuseppe (ciosrin) said : #14

Thanks Anton Gladky, that solved my question.