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

Error in Running Python Scripts

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2017, 11:27
Default Error in Running Python Scripts
  #1
New Member
 
Join Date: Feb 2017
Posts: 2
Rep Power: 0
stebbt is on a distinguished road
Hello,

I am trying to install SU2 v5.0.0. When I attempt to run python scripts such as shape_optimization.py I get the following error:

stebbt@stebbt-VirtualBox:~/su2_o/bin$ shape_optimization.py -f inv_ONERAM6_adv.cfg
Traceback (most recent call last):
File "/usr/local/bin/shape_optimization.py", line 36, in <module>
sys.path.append(os.environ['SU2_RUN'])
File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
raise KeyError(key)
KeyError: 'SU2_RUN'

I configured using:

./configure --prefix=/home/stebbt/su2_o CXXFLAGS="-O3" --enable-mpi --with-cc=/home/stebbt/mpi_install/bin/mpicc --with-cxx=/home/stebbt/mpi_install/bin/mpicxx --enable-PY_WRAPPER

and set my environment variables in /.bashrc:

export SU2_RUN="/home/stebbt/su2_opt/bin"
export SU2_HOME="/home/stebbt/SU2"
export PATH=$PATH:$SU2_RUN
export PYTHONPATH=$PYTHONPATH:$SU2_RUN

I am new to Linux so I am not sure if I have the paths set correctly. Any help would be greatly appreciated!

EDIT: I tried exporting the paths directly in the terminal command line and it seemed to correct the issue, I can now run the python scripts. I know this is more of a linux question, but does that mean /.bashrc is not being read/used when using my terminal?

Last edited by stebbt; May 1, 2017 at 12:06. Reason: /.bashrc not being read by terminal
stebbt is offline   Reply With Quote

Old   May 4, 2017, 05:01
Default
  #2
Super Moderator
 
Tim Albring
Join Date: Sep 2015
Posts: 195
Rep Power: 10
talbring is on a distinguished road
You should add these lines to the file ~/.bashrc not /.bashrc (maybe it is just a typo though). Furthermore you install SU2 to /home/stebbt/su2_o but SU2_RUN points to /home/stebbt/su2_opt/bin
talbring is offline   Reply With Quote

Reply

Tags
python script error, su2_run error


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.org] Error running #codeStream/functions wmake lnInclude fails to open *.H Files tarik OpenFOAM Installation 8 June 14, 2020 03:12
[foam-extend.org] Foam Extend 3.2 in ubuntu 16.04 LTS JMosiezny OpenFOAM Installation 15 December 9, 2017 08:20
OpenFOAM parallel on VM? pimpleDyMFoam propeller tutorial has been running for hours. MBttR OpenFOAM Running, Solving & CFD 0 June 13, 2016 10:58
Hypersonic Sim (running at Mach 7): floating point exception has occurred bungusbeefcake STAR-CCM+ 10 March 31, 2015 06:59
Fluent 14.0 file not running in parallel mode in cluster tejakalva FLUENT 0 February 4, 2015 07:02


All times are GMT -4. The time now is 23:19.