PYTHONPATH problem

Asked by Michele Griffa

Hello to everyone

I'm facing the following problem.

I have just installed, apparently without any evident problem, ESyS-Particle 2.1 on Ubuntu 10.10 with Python 2.6 and Boost libraries 1.42.

I also installed the latest version of the LSMGenGeo library, downloaded from the ESSCC's SVN server as indicated in the thread #152006.

Both ESyS-Particle and LSMGenGeo have been installed in the default directories (/usr/local/lib and /usr/local/bin and /usr/local/lib/python2.6/dist-packages for the Python shared libraries). For the ESyS-Particle installation, I followed the instructions in the thread #159682.

I also setup in my .bashrc profile configuration file the definition of the environment variables PATH, LD_LIBRARY_PATH nad PYTHON_PATH.

When I try to run a LSMGenGeo Python script for creating a model it cannot find the Python GenGeo module, as if the PYTHONPATH content was not taken into account at all.

I'm using the default Python 2.6 installation that comes with the distro itself.

Is there anyone who has experienced a similar problem as I'm doing ?

Thanks for the info in advance

Best regards

Michele

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Michele Griffa
Solved:
Last query:
Last reply:
Revision history for this message
Vince Boros (v-boros) said :
#1

Hello Michele:

I expect that your PYTHONPATH variable has both /usr/local/lib/python2.6/dist-packages for ESyS-Particle and /usr/local/lib/python2.6/dist-packages/gengeo for LsmGengeo. Check that the latter path in fact exists and that it contains the GenGeo.so library. If it does not exist, then this may well be the cause of the problem.

If it exists but does not contain the GenGeo library, I have noticed that libraries can instead be installed at times under /usr/local/lib/python2.6/site-packages for ESyS-Particle and /usr/local/lib/python2.6/site-packages/gengeo for LsmGengeo. I think that this variation would happen for Python installations from other than the Ubuntu distribution, and so probably is not the answer in your case.

Let me know if one of these suggestions works.

Best regards,

Vince

Revision history for this message
Dion Weatherley (d-weatherley) said :
#2

Hi Michele,

I suspect that the problem is simply in your PYTHONPATH, as Vince suggested. Try setting your PYTHONPATH per the following:

export PYTHONPATH=/usr/local/lib/python2.6/dist-packages/:/usr/local/lib/python2.6/dist-packages/gengeo:$PYTHONPATH

For info, we have placed the GenGeo installation in a gengeo/ subdirectory to avoid a conflict with the ESyS-Particle installation.

Cheers,

Dion.

Revision history for this message
Michele Griffa (michele-griffa) said :
#3

Hello Vince and Dion

I'm still having the same problem and it seems weird to me.

Here a little bit more of details.

First of all, the problem itself.

I'm trying to run this LSMGenGeo Python script:

from GenGeo import *
from granular_gouge3D_MGriffa_3 import *

# ######################################################################################
# Size of the rectangular prism containing the initial assembly of particles constituting the
# gouge.

E = 70.0
F = 5.0
G = F
H = 12.5
I = 22.5

xsize = E
ysize = F + H + G
zsize = I
minPoint = Vec3(0,0,0)
maxPoint = Vec3(xsize,ysize,zsize)

......

The error comes already when the first 3D vector object is created:

python gouge3D_example_MGriffa_3.py
Traceback (most recent call last):
  File "gouge3D_example_MGriffa_3.py", line 36, in <module>
    minPoint = Vec3(0,0,0)
NameError: name 'Vec3' is not defined

So, I thought that Python could not import the GenGeo module.
At least yesterday, in addition to that error message it was also signaling that GenGeo module was not found.
Now the latter error is gone but still the vec3 class is not loaded.

This is what I put in my .bashrc config file:

# Set environment variables to run ESyS-Particle simulations and compile LSMGenGeo models
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=/usr/local/lib/python2.6/dist-packages/esys/:/usr/local/lib/python2.6/dist-packages/gengeo/:$PYTHONPATH
export PATH=/usr/local/bin/:$PATH

Is the Vec3 class not existent anymore in EsyS-Particle 2.1 ?

Thanks again for your support

Michele

Revision history for this message
Vince Boros (v-boros) said :
#4

Hi Michele:

I have only scanned your reply because I have to leave work now, so I may have missed something; but I think that if you change ``Vec3'' to ``Vector3'' in your LsmGenGeo script the NameError will go away. I changed the name to avoid naming conflicts with ESyS-Particle's Vec3.

Vince

Revision history for this message
Michele Griffa (michele-griffa) said :
#5

Hi Vince

Thanks

That solved my problem, but there's another, related to another issue that has been highlighted in this forum at another thread.
I'm gonna post along that thread.

Thanks again

M