i am trying to install FEniCS adapter and i have several problems trying to install it; let’s start with the first problem, when i run pip3 uninstall -y fenics-ufl, i get a permission error like this
Uninstalling fenics-ufl-2019.1.0:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/shutil.py", line 550, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/fenics_ufl-2019.1.0.dist-info/' -> '/tmp/pip-uninstall-704m9jfp'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/hisham/.local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
status = self.run(options, args)
File "/home/hisham/.local/lib/python3.6/site-packages/pip/_internal/commands/uninstall.py", line 86, in run
auto_confirm=options.yes, verbose=self.verbosity > 0,
File "/home/hisham/.local/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 658, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File "/home/hisham/.local/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 386, in remove
moved.stash(path)
File "/home/hisham/.local/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 275, in stash
renames(path, new_path)
File "/home/hisham/.local/lib/python3.6/site-packages/pip/_internal/utils/misc.py", line 324, in renames
shutil.move(old, new)
File "/usr/lib/python3.6/shutil.py", line 562, in move
rmtree(src)
File "/usr/lib/python3.6/shutil.py", line 486, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib/python3.6/shutil.py", line 444, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/lib/python3.6/shutil.py", line 442, in _rmtree_safe_fd
os.unlink(name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'REQUESTED'```, it only works if i used sudo with it
*cloned python binding
*run python3 setup.py install --user
*check if bindings are installed by running pip3 list, and found pyprecice 2.2.1.1+1.gf3b5761 in the list
*install fenics by running
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install fenics```
from https://fenicsproject.org/download/ under section install on Ubuntu
* clone adapter repository , inside it i run pip3 install --user ., it builds normally
* then trying to import
```python3 -c "import fenicsprecice"```
From here starts the problems, first it gave me an error
```ImportError: cannot import name 'sub_forms_by_domain'```
fixed it by running ```pip3 uninstall -y fenics-ufl```
then try to run the tests, it gave me
```est_version (tests.integration.test_fenicsprecice.TestAdapter) ... /usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(args, **kwds)
/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(args, **kwds)
ok
test_checkpoint_mechanism (tests.integration.test_fenicsprecice.TestCheckpointing) ... ERROR
test_update_expression_scalar (tests.integration.test_fenicsprecice.TestExpressionHandling) ... ERROR
test_update_expression_vector (tests.integration.test_fenicsprecice.TestExpressionHandling) ... ERROR
test_scalar_read (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_scalar_write (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_vector_read (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_vector_write (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_convert_fenics_to_precice (tests.unit.test_adapter_core.TestAdapterCore) ... ERROR
test_get_coupling_boundary_edges (tests.unit.test_adapter_core.TestAdapterCore) ... ok```
tried to fixed it by downgrading numpy as i googled, started to give me the error of
```ModuleNotFoundError: No module named 'ufl'```.
* i uninstalled everything and did the same steps, currently when i keep fenics-ufl installed it gives me
```ImportError: cannot import name 'sub_forms_by_domain'``` and when i uninstall it, it gives me
```ModuleNotFoundError: No module named 'ufl'```. In addition when i try to run ```pip3 uninstall -y fenics-ufl``` it gives me permission error as you see in the post
i did the same steps you said and the problem still exist, i made a video of my installation process, it is in the link, try to download it and see it because, it is with bad quality online. until the import step everything works fine, but trying to clone adapter repository and run tests, everything crashes.
I think you can ignore these failing tests and are good to go. I assume that for running the tests you would need to build the bindings yourself (which can also be done via pip) instead of installing them via PyPI.
Lets reduce the complexities and try to figure out why the tests are not working. Firstly I would suggest just work on a normal terminal (open it using Ctrl + Alt + T) rather than the terminal in VS Code. Secondly clone the fenics-adapter and install it from source before running the tests. To install from source, go to the fenics-adapter folder after cloning and run pip3 install --user .. If then the ufl package is not found, try to install it manually via pip.
And of course as @ajaust has already suggested, just try to run a case or use the adapter, perhaps the failing tests are really independent of the adapter installation and the adapter itself has been installed correctly.
i tried running the tests with ubuntu terminal and installing adapter form repository still same problem, but the partitioned heat equation works fine and give me results. Regarding my python version is 3.6.9, and my scipy is a little bit old 1.4.1 i will try to upgrade it and see what happens
The python version 3.6.9 is known to have problems, so this explains the failing tests. More details can be found here. For now the way ahead would be to just continue using the adapter without testing it.