Closed Kerro-junior closed 1 year ago
Hi @Kerro-junior. Unfortunately I can't reproduce this problem. Can you pleas try to run pytest --nogpu
? This might give us some additional clues about the problem.
It takes hours in the 'solving' process when running conda env create -f devtools/conda-envs/gninatorch.yaml`
It is known that conda
can be very slow in solving an environment. I'd strongly recommend to use mamba instead. For me it took less than two minutes to create the environment with mamba env create -f devtools/conda-envs/gninatorch.yaml
.
I have created this environment and install all the libraries manually.
How did you install the libraries manually? With conda
? There are known incompatibilities with libmolgrid
and openbabel
(see https://github.com/gnina/libmolgrid/issues/62), therefore you should be careful about how you install those.
PS: I took the freedom to re-format your issue. Please use code blocks and inline code blocks to make things a bit more readable than plain text.
For your questions, I manually installed the libraries by the consequence you provided in yml file with conda.(but libmolgrid with pip).
I try use $pytest --nogpu
but it also leads to Segmentation fault (core dumped)
$ ls
build CODE_OF_CONDUCT.md docs gninatorch LICENSE __pycache__ README.md setup.cfg tests
CITATION.cff devtools examples gninatorch.egg-info MANIFEST.in pytest.ini readthedocs.yml setup.py versioneer.py
$ pytest --nogpu
Segmentation fault (core dumped)
I will look into the incompatibilities between libmolgrid and openbabel later, and tried use mamba to create environment.
sorry to bother you, but I still cannot use mamba to install the gnina-torch, actually I do not know why I can't install mamba in conda, it always solving the imcompatibility
.
do you have any idea of the reason of
$ pytest --nogpu
Segmentation fault (core dumped)
Unfortunately I can't reproduce the problem on my end, therefore it is a bit difficult to know what's going on.
do you have any idea
Since nothing is printed before the segmentation fault (not even the initial pytest
stuff), I'd suspect the failure is happening within conftest.py
. This would suggest there might be some issues with your molgrid
installation.
it always solving the imcompatibility
As mentioned above, conda is notoriously slow in these situations. In my experience, this was happening when you try to install new things in an already bloated environment (an environment with many different packages, or the base
environment if used for everything). But I haven't seen this issue since I switched to mamba
.
why I can't install mamba in conda
If you look at the mamba
installation instructions, you will see that installing mamba
with conda
is not recommended. Therefore, I'd suggest to try a fresh install from Mambaforge.
Thanks for your advice, I have successfully installed mambaforge into my base environment, and I have successfully used mamba to create gninatorch environment( I notive this env uses python3.11), then use python -m pip install .
successfully installed gninatorch package.
BUT, the pytest still has troubles:
......
Building wheels for collected packages: gninatorch
Building wheel for gninatorch (setup.py) ... done
Created wheel for gninatorch: filename=gninatorch-0.0.2+3.ge46cb51-py3-none-any.whl size=37053758 sha256=76adaede79bdab7484c927344773e4a6612ce7ae60fe89e4da09f792cadaf349
Stored in directory: /tmp/pip-ephem-wheel-cache-p64x6wx4/wheels/af/ee/f2/cba9368ce892555bc0147841fd0a14502c3d17893e4b99760d
Successfully built gninatorch
Installing collected packages: pyquaternion, molgrid, gninatorch
Attempting uninstall: gninatorch
Found existing installation: gninatorch 0.0.2+3.ge46cb51
Can't uninstall 'gninatorch'. No files were found to uninstall.
Successfully installed gninatorch-0.0.2+3.ge46cb51 molgrid-0.5.3 pyquaternion-0.9.9
(gninatorch) [/home/user/gnina-torch]$ pytest --cov=gninatorch
-bash: /data2/rjli/bin/pytest: /data2/rjli/anaconda3/bin/python3.10: bad interpreter: No such file or directory
Then I check some basic information about python:
(gninatorch) [/home/user/gnina-torch]$ python
Python 3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
then I tried base environment to do pytest, still error
(gninatorch) [/home/user/gnina-torch]$ mamba activate base
(base) [/home/user/gnina-torch]$ pytest --cov=gninatorch
-bash: /data2/rjli/bin/pytest: /data2/rjli/anaconda3/bin/python3.10: bad interpreter: No such file or directory
/data2/rjli/anaconda3/bin/python3.10
There is clearly something off with your configuration, since it is picking up Python not from the environment.
mamba
? Try to re-start the shell and re-activate the gina-torch
environment.pytest
correctly installed in your environment? Try to use python -m pytest --cov=gninatorch
to make sure.I have successfully installed mambaforge into my base environment
As mentioned previously, this is not recommended by the mamba
community, so it might also be part of the problem.
Thanks, I have re-active the gninatorch
environment, and it finally reports the test information:
$ python -m pytest --cov=gninatorch
ImportError while loading conftest '/data2/rjli/gnina-torch/tests/conftest.py'.
tests/conftest.py:3: in <module>
import molgrid
../anaconda3/lib/python3.11/site-packages/molgrid/__init__.py:1: in <module>
from .molgrid import *
E SystemError: type Boost.Python.enum has the Py_TPFLAGS_HAVE_GC flag but has no traverse function
Sorry to bother you, but I have no idea how to handle this libmolgrid import error...
Can you please try to build an environment with Python 3.10 and see if something changes?
I firstly use mamba update python=3.10
to change the gninatorch environment's python, then I run the pytest and got:
(gninatorch)$ python -m pytest --cov=gninatorch
version `GLIBCXX_3.4.30' not found (required by ~/mambaforge/envs/gninatorch/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
Failed to import torch.
ImportError while loading conftest 'gnina-torch/tests/conftest.py'.
tests/conftest.py:5: in <module>
import torch
../mambaforge/envs/gninatorch/lib/python3.10/site-packages/torch/__init__.py:199: in <module>
from torch._C import * # noqa: F403
So I delete the specific gcc I defined in the ~/.bashrc, and run the pytest again:
$ python -m pytest --cov=gninatorch
ImportError while loading conftest '/home/user/gnina-torch/tests/conftest.py'.
tests/conftest.py:3: in <module>
import molgrid
../anaconda3/lib/python3.11/site-packages/molgrid/__init__.py:1: in <module>
from .molgrid import *
E SystemError: type Boost.Python.enum has the Py_TPFLAGS_HAVE_GC flag but has no traverse function
HOW STRANGE it is! the python of gninatorch turn into python3.11 again?I tried again 'mamba update python=3.10' to update python into 3.10 but failed.SO I remove the env and modify the .yaml
file in /devtools/conda-envs
as 'python=3.9' (I saw a mamba warning about molgrid require python3.9
specifically), and thenpython -m pip install .
Then I conda activate gninatorch
, the python is still 3.11, Later I realized I need to use 'mamba activate gninatorch
' to use the python3.9 installed in gninatorch. If I use 'conda activate gninatorch' the python will always point to /anaconda3/bin/python3.11
So finally after I installed the gninatorch with mamba, BUT it constantly report errors:
ImportError while loading conftest '/data2/rjli/gnina-torch/tests/conftest.py'.
tests/conftest.py:5: in <module>
import torch
../mambaforge/envs/gninatorch/lib/python3.9/site-packages/torch/__init__.py:199: in <module>
from torch._C import * # noqa: F403
E ImportError: /home/software/support/gcc/950/lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/user/mambaforge/envs/gninatorch/lib/python3.9/site-packages/torch/lib/libtorch_python.so)
I learned that it's the problem of my gcc, FYI my gcc is assigned by adding source /home/software/ENV/support/gcc/gcc-9.5.0.env
, and when I run 'which gcc' it echos: /home/software/support/gcc/950/bin/gcc
I would be grateful if you can teach how to solve the problem ImportError: /home/software/support/gcc/950/lib64/libstdc++.so.6: version
GLIBCXX_3.4.30' not found`, casue I know little about these stuff...
@Kerro-junior thanks for checking. Since this is a problem with how your setup is (mis-)configured, I can't help much. You will have to fix how things are setup on your end.
What I can suggest is to try to install a newer version of GCC from coda-forge
within your gninatorch
environment:
mamba install -c condo-forge gcc=12.1.0
Test Error
System Details
CentOS7 Linux server Anaconda environment (python3.9)
I have created this environment and install all the libraries manually.
(It takes hours in the 'solving' process when running
conda env create -f devtools/conda-envs/gninatorch.yaml
, so I quit and created a environment 'gninatorch' and install libraries one by one as the yml shows)After all dependencies have been installed (I additionally installed
scikit-learn-intelex
as thescikit-learn
suggests), I runpython -m pip install .
thegninatorch 0.0.2+3.ge46cb51
successfully installed. BUT It could not success at$ pytest --cov==gninatorch
.