1

I have recently installed the FiPy package onto my Macbook, with all the dependencies, through MacPorts. I have no troubles calling FiPy and NumPy as packages in Python.

Now that I have it working I want to go through the examples. However, I cannot find the "base directory" or FiPy Directory in my computer.

How can I find the base directory? Do I even have the base directory if I have installed all this via Macports?

As a note I am using Python27.

Please, help! Thanks.

wgwz
  • 2,642
  • 2
  • 23
  • 35

3 Answers3

2

From the FiPy docs (http://www.ctcms.nist.gov/fipy/README.html):

When references are made to file system paths, it is assumed that the current working directory is the FiPy distribution directory, refered to as the “base directory”, such that:

examples/diffusion/steadyState/mesh1D.py

will correspond to, e.g.:

/some/where/FiPy-X.Y/examples/diffusion/steadyState/mesh1D.py

This just means the working directory if the FiPy repository is cloned or tarball unpacked and then the directory is changed to fipy/. It will have setup.py and examples/ in there. If you install FiPy without cloning or using the tarball (e.g. using pip instead) the distribution directory (base directory) won't be readily available.

It isn't the path returned from import fipy; print(fipy.__file__). That's the installation path.

wd15
  • 1,068
  • 5
  • 8
0

Try:

import FiPy
print FiPy.__file__
user3557327
  • 1,109
  • 13
  • 22
  • Thank you for the response. I tried this and get a path the ends as, "/__init__.pyc" What do I do with this path? – wgwz Sep 11 '14 at 00:45
  • Still not sure what to do. More help would be appreciated. Thanks. – wgwz Sep 11 '14 at 03:02
  • The .pyc file is the python compiled bytecode file. What you want is the path that contains that file. – user3557327 Sep 11 '14 at 17:36
0

Since I had the same issue with Ubuntu I post this here. If you have installed it using miniconda or anaconda, it will be:

/home/username/miniconda<version>/envs/<name of the environemnt you installed fipy in> if you get the error that fipy module not found, you dont need to export the path but you just need to: conda activate <nameOfEnvironment you installed fipy there>