-
Notifications
You must be signed in to change notification settings - Fork 401
/
INSTALL
200 lines (140 loc) · 6.09 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# -----------------------------------------------------------
# SUAVE Installation Guide
# -----------------------------------------------------------
# Contents
- Dependencies
- Installation
- Dealing with Write Access
- Additional Options
- Un-Installation
Revision - June 22, 2015
HTML version, and more information is available at
- suavecode.github.io/download
- suavecode.github.io/develop
# -----------------------------------------------------------
# Dependencies
# -----------------------------------------------------------
# Python Version
SUAVE is developed on python versions 2.4 through 2.7.
Let us know if you find that it works on additonal versions.
# Package Requirements
numpy, scipy, matplotlib, pip
The above can be obtained at once with the installation of python
distributions like "Anaconda" and "Enthought"
See suavecode.github.io/download for recommendations for where
to get these packages individually.
# -----------------------------------------------------------
# Installation
# -----------------------------------------------------------
SUAVE uses setuptools to install, or distutils if setuptools
is unavailable.
1. Navigate to the trunk directory by command line.
This should contain 'setup.py' and directory 'SUAVE'.
setup.py is a script that will install the package.
Windows users: open the start menu and type 'cmd' to
open a command line.
2. Execute the install command.
There are two options for intalling. These commands may
require a sudo ('super-user-do') call.
A. Full-Install
This will build and copy the package to python's modules
directory (known as site-packages).
Command:
$ python setup.py install
B. Developer-Install (requires the setuptools package)
This will install a link to your local SUAVE package.
It's a nice option if you expect to be modifying source.
Command:
$ python setup.py develop
3. Test the installation
Navigate to a different directory, and try these commands:
$ python
>>> import SUAVE
>>> print SUAVE.__file__
This should print the location of the SUAVE package.
# -----------------------------------------------------------
# Dealing with Write Access
# -----------------------------------------------------------
If you don't have write-access to the python site-packages
directory, you can try these approaches to install SUAVE
# -----------------------------------------------------------
# Install to local site-packages
This involves the install option --user, and should work for
either a full install or developer install
Full Install Command:
$ python setup.py install --user
Developer Install Command:
$ python setup.py develop --user
# -----------------------------------------------------------
# Start a local site-packages folder
This involves creating a local directory, and setting up your
PYTHONPATH environment variable.
1. Create a local directory.
For example: mkdir ~/python-site-packages
2. Append this path to PYTHONPATH
A. For Unix operating systems
i. Append this line to your ~/.bashrc file
export PYTHONPATH = $PYTHONPATH:~/python-site-packages
ii. And source the bashrc file
$ source ~/.bashrc
B. For MacOS operating systems
i. Append this line to your ~/.bash_profile file
export PYTHONPATH = $PYTHONPATH:~/python-site-packages
ii. And source the bashrc file
$ source ~/.bashrc
C. For Windows operating systems
i. Open the start menu and type "environ", this opens the environment
variable editor
ii. Create or edit the PYTHONPATH "System" environment variable, appending
the full path to your custom site-package directory, separating multiple
paths with semicolons.
iii. Open a new command line window.
3. Install SUAVE
Using the example of the custom directoy '~/python-site-packages':
A. Full-Install
Command:
$ python setup.py install --prefix=~/python-site-packages
B. Developer-Install
Command:
$ python setup.py develop --prefix=~/python-site-packages
# -----------------------------------------------------------
# Additional Options
# -----------------------------------------------------------
Additional setup options, such as overriding the default install
location, can be found with the following commands:
python setup.py install --help
python setup.py uninstall --help
python setup.py develop --help
python setup.py --help
# -----------------------------------------------------------
# Un-Installation
# -----------------------------------------------------------
SUAVE requires pip to uninstall. An alternate approach is
provided further below if pip is not available.
Un-Installation with pip:
1. Navigate to the trunk directory by command line.
2. Uninstallation varies with the type of your install
These commands may require a sudo ('super-user-do') call.
A. Full-UnInstall
Use this if you performed a full-install.
Command:
$ python setup.py uninstall
B. Developer-UnInstall
Use this if you performed a developer-install.
Command:
$ python setup.py develop --uninstall
Alternate Approach:
Use this if you don't have the pip package.
1. Find your site-packages folder.
Your site-packages folder
is typically located in your python's install directory.
You can find it by using the following commands.
$ python
>>> import site
>>> site.getsitepackages()
2. Manually delete any file including the name "SUAVE".
You may also check the file 'easy_install.pth' if
it exists for references to the SUAVE package, and
delete them.
Never said this would be pretty... However it is a
typical uninstall process for python packages.