Installation

pyNastran is an easy package to install once you have the required Python modules. It’s a pure Python package so you shouldn’t have too many problems.

Install Procedure - From a Release

Overview

  • Install Python
  • Install numpy, scipy, pandas, vtk, PyQt4 (GUI)
  • Install numpy, scipy, pandas (no GUI)
  • Download pyNastran from Github
  • Navigate to pyNastran directory on the command line
  • Install the package

Download Python

v0.8 is tested against:
  • Python 2.7.12 (Windows/Linux)
  • Python 3.3 (Linux)
  • Python 3.4 (Linux)
  • Python 3.5 (Windows/Linux)
Options include:

Make sure to get 64-bit Python, so memory usage becomes a non-issue. It shouldn’t matter too much as long as your packages versions (e.g. numpy/scipy) are consistent. With either distribution, both Python and all 3rd party packages will be installed. With base Python, you need to do that yourself.

Note that Python 2.7.8+ is recommended because:

  • pyNastran is mainly tested against 2.7
  • not everything in the OP2 has been switched over to unicode from bytes
  • the GUI saves your state

Additional packages

The following packages are required.

PyNastran’s package requirements are tested with packages no older than 1 year at the time of release. If you require an older version, try changing version requirements in setup.py. It shouldn’t be that different, but pyNastran does make use of numpy’s “new” axis option in numpy.linalg.norm and there was a major bug fix in Python 2.7.7, so buyer beware.

Regarding the GUI, Python 2.7 with vtk==5.10.1 will give you the best looking GUI. The GUI in Python 3 won’t save your settings.

Download pyNastran

If you want to most recent official release, either:

  1. Run
>>> pip install pyNastran
  1. Download the most recent release (required if you don’t want to install the GUI).

If you don’t want the gui, use setup_no_gui.py instead of setup.py.

Install pyNastran

  • Navigate to pyNastran directory on the command line. The setup.py file should exist in the current directory.

  • Either run...

    1. Able to edit the source code and have the changes propogate (recommended)
    >>> python setup.py develop
    
    1. Changes will not propogate
    >>> python setup.py install
    

If you don’t want the gui for Python 2.7, use setup_no_gui.py instead of setup.py.

Install Procedure - From Source

Overview

  • Install Python
  • Install numpy, scipy, pandas, vtk, PyQt4 (GUI)
  • Install numpy, scipy, pandas (no GUI)
  • Install Sphinx, GraphViz, alabaster (for documentation)
  • Install Git
  • Clone pyNastran-master from Github
  • Install pyNastran

Install extra Python packages

Install Sphinx and alabaster

pip install Sphinx
pip install alabaster

Install Git

  • Download & install Git (required)

  • Download a GUI for Git (optional)

Install pyNastran

There are two ways to install the dev version of pyNastran

  1. Download the most recent zip version
  2. Clone pyNastran (see below). Using Git allows you to easily update to the latest dev version when you want to as well as push any commits of your own.

If you don’t want the gui for Python 2.7, use setup_no_gui.py instead of setup.py.

Cloning pyNastran using TortoiseGit

Right-click in a folder and select Git Clone.

../_images/clone.png

Enter the above information. If desired, click the branch box and and enter a branch name. Then click OK to clone the dev version.

Cloning pyNastran Using Command Line

Checkout/clone the dev code by typing (preferred):

>>> git clone https://github.com/SteveDoyle2/pynastran

To checkout a branch

>>> git.exe clone --branch v0.8 --progress -v "https://github.com/SteveDoyle2/pyNastran.git" "C:\\work\\pyNastran_v0.8"

Documentation

Two options for documentation exist.

Build Docs

Navigate to pyNastran/docs_sphinx directory on the command line.

>>> make html

Use Web docs

web docs