|
[Sponsors] |
October 21, 2014, 09:38 |
installation on Ubuntu 12.04
|
#1 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
Hi all, today I installed PyFoam on Ubuntu 12.04 but something is wrong and when i run a case I have:
Code:
Traceback (most recent call last): File "/home/user-a5/OpenFOAM/PyFoam-0.6.3/bin/pyFoamPlotRunner.py", line 3, in <module> from PyFoam.Applications.PlotRunner import PlotRunner ImportError: No module named PyFoam.Applications.PlotRunner Code:
python setup.py install --prefix=$HOME/OpenFOAM/PyFoam-0.6.3 echo "alias PF062='export PYTHONPATH=\$HOME/OpenFOAM/PyFoam/PyFoam-0.6.3/lib/python2.7/site-packages:\$PYTHONPATH; export PATH=\$HOME/OpenFOAM/PyFoam/PyFoam-0.6.3/bin:\$PATH'" >> $HOME/.bashrc |
|
October 21, 2014, 10:03 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Check with pyFoamVersion.py BTW: it can't be the "in a new shell it works because I modified .bashrc but didn't source it in the original shell" problem?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
October 21, 2014, 10:39 |
|
#3 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
Thank you for your quick reply, Bernhard. I obviously sourced the file .bashrc, after the modification :-)
I checked and the directory PyFoam really exists in $HOME/OpenFOAM/PyFoam/PyFoam-0.6.3/lib/python2.7/site-packages. Anyway I post the output of pyFoamVersion.py Code:
PROBLEM: 'from PyFoam.ThirdParty.six import print_' did not work. Seems that this is not the correct PyFoam-library Machine info: Linux | naospc-a5 | 3.13.0-37-generic | #64~precise1-Ubuntu SMP Wed Sep 24 21:37:11 UTC 2014 | x86_64 | x86_64 Python version: 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] Python executable: /usr/bin/python PYTHONPATH: /home/user-a5/OpenFOAM/PyFoam-0.6.3/lib/python-2.7/site-packages: Location of this utility: /home/user-a5/OpenFOAM/PyFoam-0.6.3/bin/pyFoamVersion.py PyFoam not in PYTHONPATH or regular search path. Don't see no sense in continuing Regular Python search-path: ['/home/user-a5/OpenFOAM/PyFoam-0.6.3/bin', '/home/user-a5/OpenFOAM/PyFoam-0.6.3/lib/python-2.7/site-packages', '/home/user-a5', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol'] |
|
October 22, 2014, 15:37 |
|
#4 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
/home/user-a5/OpenFOAM/PyFoam-0.6.3/lib/python-2.7/site-packages/PyFoam and a file /home/user-a5/OpenFOAM/PyFoam-0.6.3/lib/python-2.7/site-packages/PyFoam/Applications/PlotRunner.py If there are not then you either didn't install PyFoam correctly or PYTHONPATH is pointing to the wrong location
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|||
October 23, 2014, 04:08 |
|
#5 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
I'm sorry Bernhard, I checked and everything is as expected. About PYTHONPATH, I think it points to the correct folder
Code:
alias pf='export PYTHONPATH=/home/user-a5/OpenFOAM/PyFoam-0.6.3/lib/python-2.7/site-packages:$PYTHONPATH; export PATH=/home/user-a5/OpenFOAM/PyFoam-0.6.3/bin:$PATH' I really don't understand what happens :-( Maybe other Python versions in my computer disturb PyFoam... |
|
October 23, 2014, 06:30 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
The screenshots don't help. The titlebar with the path is unreadable. Plus comparing letter by letter for typos usually doesn't work. The only thing I trust is copying stuff from my config-file. "cd " and paste "<enter>" and see whether I'm in the correct directory
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
October 23, 2014, 06:51 |
|
#7 | |
Senior Member
|
Hi,
Quote:
Code:
lib/python2.7/site-packages so the alias should be something like Code:
alias pf='export PYTHONPATH=$HOME/OpenFOAM/PyFoam-0.6.3/lib/python2.7/site-packages:$PYTHONPATH; export PATH=$HOME/OpenFOAM/PyFoam-0.6.3/bin:$PATH' |
||
October 24, 2014, 10:22 |
|
#8 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
Dear Bernhard and Alexey, the problem was the '-' character. I apologize for having wasted your time, it was really a silly error :-(
As you can see, I've been far away from OpenFOAM and linux stuff for the last two years. Sorry again, have a good day. PS Thanks for the $HOME tip too. |
|
January 5, 2015, 10:13 |
ImportError: cannot import name isatty
|
#9 |
Member
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 14 |
Dear All,
Happy New Year Wishes !! I am using OpenFOAM 2.2.2 and i recently installed pyFoam 0.6.4 (installed it as a root). The installation was successfull but, when i try to use anyone of pyFoam commands say for instance .. pyFoamChangeBoundaryType.py ... I get an error as shown below Code:
Traceback (most recent call last): File "/usr/local/bin/pyFoamChangeBoundaryName.py", line 3, in <module> from PyFoam.Applications.ChangeBoundaryName import ChangeBoundaryName File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/ChangeBoundaryName.py", line 9, in <module> from .PyFoamApplication import PyFoamApplication File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PyFoamApplication.py", line 8, in <module> from PyFoam.Error import error,warning,FatalErrorPyFoamException,PyFoamException,isatty ImportError: cannot import name isatty Code:
Machine info: Linux | ws012sla | 3.2.0-61-generic | #93-Ubuntu SMP Fri May 2 21:31:50 UTC 2014 | x86_64 | x86_64 Python version: 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] Python executable: /usr/bin/python Python 2.7 is one development platform for PyFoam (along with Python 3) PYTHONPATH is not set Location of this utility: /usr/local/bin/pyFoamVersion.py Version 2.2.2 Fork openfoam of the installed 5 versions: extend-3.1 : /home/local/CSI/guru/foam/foam-extend-3.1 openfoam-1.7.1 : /opt/OpenFOAM-1.7.1 openfoam-171 : /opt/openfoam171 openfoam-222 : /opt/openfoam222 openfoam-230 : /opt/openfoam230 pyFoam-Version: 0.6.4 ALERT: Reported version (0, 6, 4) is different from hardcoded version (0, 6, 4, 'development') -> probably inconsistent library installation Path where PyFoam was found (PyFoam.__path__) is ['/usr/local/lib/python2.7/dist-packages/PyFoam'] Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/local/CSI/guru/.pyFoam/pyfoamrc'), ('directory', '/home/local/CSI/guru/.pyFoam/pyfoamrc.d')] Configuration files (used): [] Installed libraries: cython : No Not used. Maybe will by used later to spped up parts of PyFoam cProfile : Yes docutils : Yes version: 0.8.1 Gnuplot : No Not a problem. Version from ThirdParty is used hotshot : Yes ipdb : No Not necessary. Only makes debugging more comfortable IPython : Yes version: 2.1.0 Matches required version 2.0.0 matplotlib : Yes version: 1.1.1rc mercurial : Yes version: 2.0.2 nose : No Only needed for running the unit-tests (developers only) numpy : Yes version: 1.6.1 openpyxl : No Not a problem. Only used for exporting pandas-data to Excel-files (advanced) pandas : No Not a problem. Only used for handling of advanced data-handling ply : No Not a problem. Version from ThirdParty is used profile : Yes psyco : No Not a problem. Acceleration not possible PyQt4 : Yes version: 4.8.1 PyQt4.Qwt5 : No Only an alternate plotting back-end scipy : Yes version: 0.9.0 Tkinter : Yes version: $Revision: 81008 $ twisted : Yes version: 11.1.0 vtk : Yes version: 5.8.0 xlwt : No Not a problem. Only used for exporting pandas-data to Excel-files xlrd : No Not a problem. Only used for importing Excel-files to pandas-data Library locations cProfile : /usr/lib/python2.7/cProfile.pyc docutils : /usr/lib/python2.7/dist-packages/docutils/__init__.pyc hotshot : /usr/lib/python2.7/hotshot/__init__.pyc IPython : /usr/local/lib/python2.7/dist-packages/IPython/__init__.pyc matplotlib : /usr/lib/pymodules/python2.7/matplotlib/__init__.pyc mercurial : /usr/lib/python2.7/dist-packages/mercurial/__init__.pyc numpy : /usr/lib/python2.7/dist-packages/numpy/__init__.pyc profile : /usr/lib/python2.7/profile.pyc PyQt4 : /usr/lib/python2.7/dist-packages/PyQt4/__init__.pyc scipy : /usr/lib/python2.7/dist-packages/scipy/__init__.pyc Tkinter : /usr/lib/python2.7/lib-tk/Tkinter.pyc twisted : /usr/lib/python2.7/dist-packages/twisted/__init__.pyc vtk : /usr/lib/pymodules/python2.7/vtk/__init__.pyc Checking additional envirnoment variables Checking for PYFOAM_DIR : Location of the PyFoam-installation. Not strictly necessary PYFOAM_DIR missing from environment Checking for PYFOAM_SITE_DIR : Location of non-PyFoam-disctributions script. Set and used by some Foam-distributions PYFOAM_SITE_DIR missing from environment
__________________
Thanks and Regards Vignesh |
|
January 7, 2015, 16:12 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
/usr/local/lib/python2.7/dist-packages/PyFoam/Error.py That is a completely fresh installation or did you upgrade from an old PyFoam installation? (but it must be really ancient because isatty is there for years)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
January 8, 2015, 04:48 |
|
#11 | |
Member
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 14 |
Dear Bernhard Gschaider !
Thanks for your response !! I did a fresh installation of pyFoam 0.6.4... Is there any way to uninstall pyfoam ? I would like to reinstall it and try one more time... Quote:
__________________
Thanks and Regards Vignesh Last edited by vigneshTG; January 9, 2015 at 04:21. |
||
January 8, 2015, 05:46 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
You should be fine if you removed all files starting with pyFoam from /usr/local/bin and the whole directory /usr/local/lib/python2.7/dist-packages/PyFoam/
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
January 8, 2015, 08:20 |
|
#13 | |
Member
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 14 |
Quote:
Thanks for the tip, I removed the files as you adviced and reinstalled pyFoam. Now everything works. Thank you very much !!
__________________
Thanks and Regards Vignesh Last edited by vigneshTG; January 9, 2015 at 04:21. |
||
July 25, 2015, 09:15 |
|
#14 | |
Senior Member
Fatema Zandi Goharrizi
Join Date: Mar 2009
Posts: 158
Rep Power: 17 |
Quote:
Hello friend I appreciate if you cold help me I go for install PyFoam I unrar file got from you said with tar command then go to folder and then type the command came in wiki this is the error: for first command: Code:
fatema@fatema-2PC:~/PyFoam-0.6.5$ sudo python setup.py install [sudo] password for fatema: Traceback (most recent call last): File "setup.py", line 1, in <module> from setuptools import setup ImportError: No module named setuptools Code:
fatema@fatema-2PC:~/PyFoam-0.6.5$ sudo apt-get install python-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libexpat1-dev libssl-dev libssl-doc python2.7-dev The following NEW packages will be installed: libexpat1-dev libssl-dev libssl-doc python-dev python2.7-dev 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 32.1 MB/32.4 MB of archives. After this operation, 48.0 MB of additional disk space will be used. Do you want to continue [Y/n]? Y WARNING: The following packages cannot be authenticated! libexpat1-dev libssl-dev libssl-doc python2.7-dev python-dev Install these packages without verification [y/N]? y Err http://ir.archive.ubuntu.com/ubuntu/ precise-updates/main libssl-dev amd64 1.0.1-4ubuntu5.20 404 Not Found Err http://security.ubuntu.com/ubuntu/ precise-security/main libssl-dev amd64 1.0.1-4ubuntu5.20 404 Not Found [IP: 91.189.91.23 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main libssl-doc all 1.0.1-4ubuntu5.20 404 Not Found [IP: 91.189.91.23 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main python2.7-dev amd64 2.7.3-0ubuntu3.5 404 Not Found [IP: 91.189.91.23 80] Failed to fetch http://security.ubuntu.com/ubuntu/po...5.20_amd64.deb 404 Not Found [IP: 91.189.91.23 80] Failed to fetch http://security.ubuntu.com/ubuntu/po...tu5.20_all.deb 404 Not Found [IP: 91.189.91.23 80] Failed to fetch http://security.ubuntu.com/ubuntu/po...u3.5_amd64.deb 404 Not Found [IP: 91.189.91.23 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Last edited by wyldckat; July 25, 2015 at 10:49. Reason: Added [CODE][/CODE] markers |
||
July 25, 2015, 10:50 |
|
#15 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: You need to update the package list first:
Code:
sudo apt-get update Code:
sudo apt-get install python-dev |
|
July 25, 2015, 11:53 |
|
#16 |
Senior Member
Fatema Zandi Goharrizi
Join Date: Mar 2009
Posts: 158
Rep Power: 17 |
||
July 30, 2015, 04:47 |
|
#17 | |
Senior Member
Fatema Zandi Goharrizi
Join Date: Mar 2009
Posts: 158
Rep Power: 17 |
Quote:
Thank you again but after doing the installation and enter the checking command Code:
To test whether the installation of PyFoam is working start the interactive Python shell with python (The shell can be left with Control-D). In that shell type import PyFoam import PyFoam.FoamInformation print PyFoam.FoamInformation.foamTutorials() If the last command produces an output similar to /home/nonroot/OpenFOAM/OpenFOAM-1.2-devel/tutorials everything is well. how I can know it works fine? Thank you |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Swak4foam installation error with OF 2.2.0 (Ubuntu 12.04 LTS) | vbchris | OpenFOAM Community Contributions | 8 | March 25, 2021 21:11 |
FLUENT installation on UBUNTU 12.04 (LTS) | teymourj | FLUENT | 2 | March 1, 2017 23:24 |
[OpenFOAM.org] OpenFOAM 2.40 installation on Ubuntu 12.04 LTS | eddykendo | OpenFOAM Installation | 1 | July 18, 2015 18:38 |
Trouble shooting about OpenFOAM installation in Ubuntu 12.04 | Nait | OpenFOAM Installation | 2 | December 12, 2012 11:20 |
Openfoam 2.1 installation in ubuntu 12.04 | jsm | OpenFOAM Installation | 11 | May 7, 2012 05:56 |