So I’ve downloaded fenics several times in the past, with no issue. Today when I downloaded fenics using conda I get :
import dolfin
Traceback (most recent call last):
File “”, line 1, in
File “/anaconda3/envs/optcontrol/lib/python3.7/site-packages/dolfin/init.py”, line 142, in
from .fem.assembling import (assemble, assemble_system, assemble_multimesh,
File “/anaconda3/envs/optcontrol/lib/python3.7/site-packages/dolfin/fem/assembling.py”, line 34, in
from dolfin.fem.form import Form
File “/anaconda3/envs/optcontrol/lib/python3.7/site-packages/dolfin/fem/form.py”, line 12, in
from dolfin.jit.jit import dolfin_pc, ffc_jit
File “/anaconda3/envs/optcontrol/lib/python3.7/site-packages/dolfin/jit/jit.py”, line 18, in
raise RuntimeError(“Could not find DOLFIN pkg-config file. Please make sure appropriate paths are set.”)
RuntimeError: Could not find DOLFIN pkg-config file. Please make sure appropriate paths are set.
I have python 3.7.6 currently. Any suggestions how I can resolve this issue?
I unfortunately don’t use J notebooks. I’ve always called my fenics programs via python command. I’m not sure what the issue is because I’ve downloaded fenics several times previous on different machines and I haven’t ran into this issue. Any other tips @dokken?
I’ve found that if I make a python virtual environment with anaconda, and then install fenics (with the conda-forge command) via anaconda into that virtual environment then things work great. I just run my programs from this environment. I think the issue is that if you don’t have a closed virtual environment, there might be a chance that you pip installed something in the past that comes in conflict with anaconda.
when I do the " 1. conda create -n fenicsproject python=3.7" , I get the error:
PackagesNotFoundError: The following packages are not available from current channels:
So, what is your suggestion to install fenics on conda? consider creating a new environment. What should I do to install fenics on conda on mac if I want to use it on J notebook?
Thank you so much for your help.
Can you help me which version I should install?
You mean, if I install the newer version of python, I can install fenics with " conda install -c conda-forge fenics" ?
I updated the python to the 3.10 version but I still get error installing fenics.
PackagesNotFoundError: The following packages are not available from current channels:
What kind of system are you on?
The fenics conda package is at Fenics :: Anaconda.org and has a large variety of supported platforms and versions, see Files :: Anaconda.org
I have Pro M1 system which is arm. I used the command you suggested and activated the fenics environment and here is the conda info:
active environment : fenics
active env location : /opt/anaconda3/envs/fenics
shell level : 2
user config file : /Users/eli/.condarc
populated config files : /Users/eli/.condarc
conda version : 22.9.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
virtual packages : __osx=12.5=0
__unix=0=0
__archspec=1=arm64
base environment : /opt/anaconda3 (writable)
conda av data dir : /opt/anaconda3/etc/conda
conda av metadata url : None
channel URLs : conda-forge/osx-arm64 conda-forge/noarch main/osx-arm64 main/noarch r/osx-arm64 r/noarch
package cache : /opt/anaconda3/pkgs
/Users/eli/.conda/pkgs
envs directories : /opt/anaconda3/envs
/Users/eli/.conda/envs
platform : osx-arm64
user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Darwin/21.6.0 OSX/12.5
UID:GID : 501:20
netrc file : None
offline mode : False
Now what should I do to install jupyter at this environment? I installed it with conda install jupyter but it does not open with this.
Thank you so much for your help.