CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.org] set up python path for python in paraview compiled with openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2015, 06:22
Default set up python path for python in paraview compiled with openfoam
  #1
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
I'm trying to get paraview working in external python environments such as idle, from what I've read it's simply a matter of adding a couple of bits to the python path.

I'm using linux mint 17.2.

How do I locate the directories that need to be added to the python path?

I am using OpenFOAM 2.4
seanread is offline   Reply With Quote

Old   October 24, 2015, 15:18
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: If you are using the "paraviewopenfoam410" Debian package, it does not have Python support built into it

Edit: WAIT! I was wrong! This package already has it! The folder that needs to be added the PYTHON search path is this:
Code:
/opt/paraviewopenfoam410/lib/paraview-4.1/site-packages

Last edited by wyldckat; October 24, 2015 at 15:24. Reason: see "Edit:"
wyldckat is offline   Reply With Quote

Old   October 24, 2015, 19:05
Default
  #3
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
hey Bruno,

Thanks for getting back to me,

I didn't use the debian package - it wouldn't install on linux mint - I compiled myself, python is working fine in pvpython. Where would be the equivalent directory as compiled according to the instructions at http://www.openfoam.org/download/git.php?
seanread is offline   Reply With Quote

Old   October 25, 2015, 07:52
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Mmm... that reminds me that we can use a more generic path that should give us the path in any installation of OpenFOAM with ParaView 4.1.0:
Code:
$ParaView_DIR/lib/paraview-4.1/site-packages
And when in doubt, double-check it with these commands:
Code:
echo $ParaView_DIR/lib/paraview-4.1/site-packages
ls -l $ParaView_DIR/lib/paraview-4.1/site-packages
If by any change it doesn't work as intended, the path in 64-bit installation for 2.4.x with the system's GCC is:
Code:
$HOME/OpenFOAM/ThirdParty-2.4.x/platforms/linux64Gcc/ParaView-4.1.0/lib/paraview-4.1/site-packages
seanread likes this.
wyldckat is offline   Reply With Quote

Old   October 25, 2015, 18:52
Default
  #5
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
thanks Bruno, That did the trick just fine!
seanread is offline   Reply With Quote

Old   October 25, 2015, 21:05
Default
  #6
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
wait, check that, so now I can import paraview no worries, but paraview.simple is still giving an error "No module named vtkCommonCorePython". I checked the site-packages/vtk directory, there is a binary file called vtkCommonCorePython.so, but no .py file. Does this mean that my lib is missing files?

Last edited by seanread; October 25, 2015 at 23:05.
seanread is offline   Reply With Quote

Old   October 31, 2015, 07:28
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Googled:
Code:
ImportError: No module named vtkCommonCorePython
Got this: http://stackoverflow.com/a/24412030
Therefore, the solution is this:
Code:
export PYTHONPATH=$ParaView_DIR/lib/paraview-4.1/site-packages:$ParaView_DIR/lib/paraview-4.1/site-packages/vtk
Essy likes this.
wyldckat is offline   Reply With Quote

Old   October 31, 2015, 20:20
Default
  #8
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
Thanks Bruno, that got it working, I saw this thread but didn't think to change to the site-packages in the paraview path
seanread is offline   Reply With Quote

Reply

Tags
parafoam, python


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Using python script for automatic post processing of openFoam vPaquet ParaView 12 December 16, 2021 03:30
[OpenFOAM.org] Using OpenFOAM 2.3.0 from Deb pack in Ubuntu 14.04 + ParaView 5 from OpenFOAM 4.1 ad2eb OpenFOAM Installation 12 May 28, 2017 14:30
Ansys Licence Serve on Ubuntu 16.04 LTS david.pasquale ANSYS 2 January 20, 2017 11:52
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 06:55
Installation problems shellbell1999 OpenFOAM Installation 9 April 6, 2006 13:29


All times are GMT -4. The time now is 16:26.