Hello Teng,

On second thought, you might be facing this precise issue:

https://github.com/conda/conda/issues/448

Back when I reported it, conda didn't play well with python installations in .local, and in your 'conda info -a' output I can see this line:

user site dirs: ~/.local/lib/python2.7

This means that probably there is some kind of clash between the conda packages and the local ones. To verify, please type this:

~/envs/fenics27/bin/python -c "import sys; from pprint import pprint as p; p(sys.path)"

And you will see a line reading

'/home/teng/.local/lib/python2.7/site-packages'

right before the one corresponding to the conda environment. If I am right, this *should* work:

source activate fenics27
python -s "from dolfin import *"

If this is the case, there are three solutions:

a) Remove everything under ~/.local/lib/python*. This is what I ended up doing in my local system, and now I manage everything with conda. b) Always call python with the '-s' option: "don't add user site directory to sys.path".
c) Set the environment variable PYTHONNOUSERSITE.

Fingers crossed!

Regards,

Juan Luis

On 2015-03-31 15:34, 腾张 wrote:
Dear Juan Luis Cano,

Thank you very much for your kind help.

This is the information I got:

$ echo $PYTHONPATH

$ cd ~/envs/fenics27/share/dolfin/demo/documented/cahn-hilliard/python/
$ python demo_cahn-hilliard.py

---------------------------------------------------
DOLFIN runtime dependency is not met.
Install the following python module: 'ffc'
and make sure its location is listed in PYTHONPATH.
---------------------------------------------------


$ cd ~
$ python -c "from dolfin import *"

---------------------------------------------------
DOLFIN runtime dependency is not met.
Install the following python module: 'ffc'
and make sure its location is listed in PYTHONPATH.

I think something is wrong with the PYTHONPATH?

Best,
Teng


2015-03-31 2:11 GMT-04:00 Juan Luis Cano <[email protected] <mailto:[email protected]>>:

    Hello Teng,

    The procedure seems totally correct, yet I don't understand why
    the import is failing. By the way, if you want to paste a long
    output I encourage you to try https://gist.github.com/. More
    things you can try:

    * Is 'demo_cahn-hilliard.py' really under ~/envs/fenics27 or you
    put it there on purpose? I suggest you to move it to a less
    conflictive location and try again, for example to /tmp or
    ~/Development.
    * Or try running it from its default location:

    source activate fenics27
    cd ~/envs/fenics27/share/dolfin/demo/documented/cahn-hilliard/python/
    python demo_cahn-hilliard.py

    * Please print the contents of PYTHONPATH, just in case:

    source activate fenics27
    echo $PYTHONPATH

    * What happens if you try a plain import from Python?

    source activate fenics27
    cd ~
    python -c "from dolfin import *"

    I hope we can finally nail down this nasty problem!

    Regards,

    Juan Luis

    On 2015-03-30 22:59, 腾张 wrote:

        Dear Juan Luis Cano,

        It still does not work. Attached is the whole output during
        the installation.

        " conda create --name fenics27 python=2.7
        Fetching package metadata: ..
        Solving package specifications: .
        Package plan for installation in environment
        /home/zhangt/envs/fenics27:

        The following packages will be downloaded:

            package                    |            build
            ---------------------------|-----------------
            openssl-1.0.1k             |                1 2.6 MB
            python-2.7.9               |                2 13.4 MB
            sqlite-3.8.4.1             |                1 2.5 MB
            system-5.8                 |                2 170 KB
            tk-8.5.18                  |                0 1.9 MB
            zlib-1.2.8                 |                0 100 KB
        ------------------------------------------------------------
                                                   Total: 20.6 MB

        The following NEW packages will be INSTALLED:

            openssl:  1.0.1k-1
            python:   2.7.9-2
            readline: 6.2-2     (soft-link)
            sqlite:   3.8.4.1-1
            system:   5.8-2
            tk:       8.5.18-0
            zlib:     1.2.8-0

        Proceed ([y]/n)? y

        Fetching packages ...
        openssl-1.0.1k 100%
        |###########################################################
        python-2.7.9-2 100%
        |###########################################################
        sqlite-3.8.4.1 100%
        |###########################################################
        system-5.8-2.t 100%
        |###########################################################
        tk-8.5.18-0.ta 100%
        |###########################################################
        zlib-1.2.8-0.t 100%
        |###########################################################
        Extracting packages ...
        [      COMPLETE      ]
        |########################################################
        Linking packages ...
        [      COMPLETE      ]
        |########################################################
        #
        # To activate this environment, use:
        # $ source activate fenics27
        #
        # To deactivate this environment, use:
        # $ source deactivate
        #
        [zhangt@eofe4 ~]$ source activate fenics27
        discarding /cm/shared/engaging/anaconda/2.1.0/bin from PATH
        prepending /home/zhangt/envs/fenics27/bin to PATH
        (fenics27)[zhangt@eofe4 ~]$ conda install dolfin boost=1.55
        eigen3 petsc petsc4p                                     y
        instant ufl fiat ffc --channel juanlu001
        Fetching package metadata: ...
        Solving package specifications: .
        Package plan for installation in environment
        /home/zhangt/envs/fenics27:

        The following packages will be downloaded:

            package                    |            build
            ---------------------------|-----------------
            boost-1.55.0               |                1 6.2 MB
            cmake-3.0.1                |                0 10.3 MB
            dolfin-1.5.0               |       np19py27_1 42.3 MB
            eigen3-3.2.1               |                0 524 KB
            fastcache-1.0.2            |           py27_0  40 KB
            ffc-1.5.0                  |       np19py27_1 592 KB
            fiat-1.5.0                 |       np19py27_1  63 KB
            fontconfig-2.11.1          |                2 402 KB
            freetype-2.5.2             |                0 2.5 MB
            instant-1.5.0              |       np19py27_1  45 KB
            mkl-11.1                   |      np19py27_p3   4 KB
            mkl-rt-11.1                |               p0 100.1 MB
            mkl-service-1.0.0          |          py27_p1  23 KB
            nose-1.3.4                 |           py27_1 189 KB
            numpy-1.9.2                |           py27_0 7.8 MB
            pcre-8.31                  |                0 534 KB
            petsc-3.5.2                |           py27_1 16.8 MB
            petsc4py-3.5.1             |           py27_1 3.1 MB
            qt-4.8.6                   |                0 35.2 MB
            scipy-0.15.1               |       np19py27_0 37.0 MB
            six-1.9.0                  |           py27_0  17 KB
            swig-3.0.2                 |                0 1.9 MB
            sympy-0.7.6                |           py27_0 6.2 MB
            ufl-1.5.0                  |           py27_1 290 KB
            vtk-5.10.1                 |           py27_1 92.2 MB
        ------------------------------------------------------------
                                                   Total: 364.1 MB

        The following NEW packages will be INSTALLED:

            boost:        1.55.0-1
            cmake:        3.0.1-0
            dolfin:       1.5.0-np19py27_1
            eigen3:       3.2.1-0
            fastcache:    1.0.2-py27_0
            ffc:          1.5.0-np19py27_1
            fiat:         1.5.0-np19py27_1
            fontconfig:   2.11.1-2
            freetype:     2.5.2-0
            instant:      1.5.0-np19py27_1
            libpng:       1.5.13-1          (soft-link)
            libxml2:      2.9.0-0           (soft-link)
            mkl:          11.1-np19py27_p3
            mkl-rt:       11.1-p0
            mkl-service:  1.0.0-py27_p1
            mpi4py:       1.3-py27_0        (soft-link)
            mpich2:       1.4.1p1-0         (soft-link)
            nose:         1.3.4-py27_1
            numexpr:      2.3.1-np19py27_0  (soft-link)
            numpy:        1.9.2-py27_0
            pcre:         8.31-0
            petsc:        3.5.2-py27_1
            petsc4py:     3.5.1-py27_1
            ply:          3.4-py27_0        (soft-link)
            qt:           4.8.6-0
            scikit-learn: 0.15.2-np19py27_0 (soft-link)
            scipy:        0.15.1-np19py27_0
            six:          1.9.0-py27_0
            swig:         3.0.2-0
            sympy:        0.7.6-py27_0
            ufl:          1.5.0-py27_1
            vtk:          5.10.1-py27_1

        Proceed ([y]/n)? y

        Fetching packages ...
        boost-1.55.0-1 100% |################################| Time:
        0:00:00  12.70 MB/s
        cmake-3.0.1-0. 100% |################################| Time:
        0:00:01  10.48 MB/s
        dolfin-1.5.0-n 100% |################################| Time:
        0:00:01  23.17 MB/s
        eigen3-3.2.1-0 100% |################################| Time:
        0:00:00   3.17 MB/s
        fastcache-1.0. 100% |################################| Time:
        0:00:00   1.33 MB/s
        ffc-1.5.0-np19 100% |################################| Time:
        0:00:00   1.40 MB/s
        fiat-1.5.0-np1 100% |################################| Time:
        0:00:00   1.07 MB/s
        fontconfig-2.1 100% |################################| Time:
        0:00:00   2.09 MB/s
        freetype-2.5.2 100% |################################| Time:
        0:00:00   5.15 MB/s
        instant-1.5.0- 100% |################################| Time:
        0:00:00   1.03 MB/s
        mkl-11.1-np19p 100% |################################| Time:
        0:00:00   2.72 MB/s
        mkl-rt-11.1-p0 100% |################################| Time:
        0:00:03  34.82 MB/s
        mkl-service-1. 100% |################################| Time:
        0:00:00   1.53 MB/s
        nose-1.3.4-py2 100% |################################| Time:
        0:00:00   1.80 MB/s
        numpy-1.9.2-py 100% |################################| Time:
        0:00:00   9.44 MB/s
        pcre-8.31-0.ta 100% |################################| Time:
        0:00:00   2.76 MB/s
        petsc-3.5.2-py 100% |################################| Time:
        0:00:00  20.50 MB/s
        petsc4py-3.5.1 100% |################################| Time:
        0:00:00   7.92 MB/s
        qt-4.8.6-0.tar 100% |################################| Time:
        0:00:01  18.91 MB/s
        scipy-0.15.1-n 100% |################################| Time:
        0:00:01  21.09 MB/s
        six-1.9.0-py27 100% |################################| Time:
        0:00:00   1.10 MB/s
        swig-3.0.2-0.t 100% |################################| Time:
        0:00:00   4.59 MB/s
        sympy-0.7.6-py 100% |################################| Time:
        0:00:00   8.70 MB/s
        ufl-1.5.0-py27 100% |################################| Time:
        0:00:00   2.39 MB/s
        vtk-5.10.1-py2 100% |################################| Time:
        0:00:03  31.01 MB/s
        Extracting packages ...
        [      COMPLETE      ]
        
|##########################################################################################################################################|
        100%
        Linking packages ...
        [      COMPLETE      ]
        
|##########################################################################################################################################|
        100%
        (fenics27)[zhangt@eofe4 ~]$ cd envs/fenics27/
        (fenics27)[zhangt@eofe4 fenics27]$ python demo_cahn-hilliard.py

        ---------------------------------------------------
        DOLFIN runtime dependency is not met.
        Install the following python module: 'ffc'
        and make sure its location is listed in PYTHONPATH.
        ---------------------------------------------------"

        Thanks a lot for your kind help.

        Best,
        Teng




_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to