vitroid / GenIce

A swiss army knife to generate proton-disordered ice structures.
MIT License
61 stars 20 forks source link

Unsuccessful installation, numpy version issue #10

Closed smutao closed 3 years ago

smutao commented 3 years ago

Hello, I'm trying to install genice2 in a newly created conda environment. I first installed all dependent packages via pip3, then installed genice2, but it seems that genice2 cannot run.

Please see my pip3 list: (genice) raymond@pop-os:~$ pip3 list Package Version

certifi 2021.5.30 cycless 0.1.4 decorator 4.4.2 GenIce2 2.1.1 graphstat 0.2.1 methodtools 0.4.3 networkx 2.5.1 numpy 1.19.3 openpyscad 0.5.0 PairList 0.2.11.1 pip 21.1.2 setuptools 52.0.0.post20210125 six 1.16.0 TileCycles 0.1.5.2 wheel 0.36.2 wirerope 0.4.3 yaplotlib 0.1.2

After I run "genice2 -h" or "genice2 --version", I got: (genice) raymond@pop-os:~$ genice2 --version RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd Traceback (most recent call last): File "/home/raymond/miniconda3/envs/genice/bin/genice2", line 5, in from genice2.cli.genice import main File "/home/raymond/miniconda3/envs/genice/lib/python3.9/site-packages/genice2/cli/genice.py", line 8, in from genice2.genice import GenIce File "/home/raymond/miniconda3/envs/genice/lib/python3.9/site-packages/genice2/genice.py", line 16, in import pairlist as pl File "/home/raymond/miniconda3/envs/genice/lib/python3.9/site-packages/pairlist.py", line 10, in from cpairlist import pairs, pairs2 ImportError: numpy.core.multiarray failed to import

My conda list is: (genice) raymond@pop-os:~$ conda list # packages in environment at /home/raymond/miniconda3/envs/genice: # # Name Version Build Channel _libgcc_mutex 0.1 main
_openmp_mutex 4.5 1_gnu
ca-certificates 2021.5.25 h06a4308_1
certifi 2021.5.30 py39h06a4308_0
cycless 0.1.4 pypi_0 pypi decorator 4.4.2 pypi_0 pypi genice2 2.1.1 pypi_0 pypi graphstat 0.2.1 pypi_0 pypi ld_impl_linux-64 2.35.1 h7274673_9
libffi 3.3 he6710b0_2
libgcc-ng 9.3.0 h5101ec6_17
libgomp 9.3.0 h5101ec6_17
libstdcxx-ng 9.3.0 hd4cf53a_17
methodtools 0.4.3 pypi_0 pypi ncurses 6.2 he6710b0_1
networkx 2.5.1 pypi_0 pypi numpy 1.19.3 pypi_0 pypi openpyscad 0.5.0 pypi_0 pypi openssl 1.1.1k h27cfd23_0
pairlist 0.2.11.1 pypi_0 pypi pip 21.1.2 py39h06a4308_0
python 3.9.5 h12debd9_4
readline 8.1 h27cfd23_0
setuptools 52.0.0 py39h06a4308_0
six 1.16.0 pypi_0 pypi sqlite 3.35.4 hdfb4753_0
tilecycles 0.1.5.2 pypi_0 pypi tk 8.6.10 hbc83047_0
tzdata 2021a h52ac0ba_0
wheel 0.36.2 pyhd3eb1b0_0
wirerope 0.4.3 pypi_0 pypi xz 5.2.5 h7b6447c_0
yaplotlib 0.1.2 pypi_0 pypi zlib 1.2.11 h7b6447c_3

Then I uninstalled the numpy1.19.3 and installed numpy 1.21.0 instead, it seems to work now.

vitroid commented 3 years ago

Thank you for your report. The problem would be caused by pairlist library (also developed by myself). I replaced the precompiled package in PyPI repository with a package without binaries. (PairList ver. 0.2.11.3) I hope it will fix the problem.

smutao commented 3 years ago

Hello Professor Matsumoto, thank you for your reply. I'm now trying to use the "genice2-cif" plugin but had some similar issue with the numpy version.

As I install genice2 from the "pip" command, I still need to reinstall the numpy-1.21.0 version manually to make genice2 work properly.

Now after installing the "genice2-cif" from "pip", I had to reinstall the numpy-1.21.0 version again. However, the plugin complains about the numpy version.

% genice2 usage: genice2 [-h] [--version] [--rep REP REP REP] [--shift SHIFT SHIFT SHIFT] [--dens DENS] [--add_noise percent] [--seed SEED] [--format name] [--water model] [--guest 14=me] [--Guest 13=me] [--Group 13=bu-:0] [--anion 3=Cl] [--cation 3=Na] [--depol DEPOL] [--asis] [--debug] [--quiet] [--assess_cages] Type genice2: error: the following arguments are required: Type

It is fine to run without the plugin option.

% genice2 cif INFO Extra lattice plugin: cif INFO main: end. INFO main: 41 ms Traceback (most recent call last): File "/home/raymond/miniconda3/envs/genice-cif/bin/genice2", line 8, in sys.exit(main()) File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/genice2/decorators.py", line 14, in _time_it return func(*args, kwargs) File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/genice2/decorators.py", line 34, in _banner return func(*args, *kwargs) File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/genice2/cli/genice.py", line 214, in main safe_import( File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/genice2/plugin.py", line 279, in safe_import module = import_extra(category, name) File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/genice2/plugin.py", line 233, in import_extra module = ep.load() File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/pkg_resources/init.py", line 2449, in load self.require(args, kwargs) File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/pkg_resources/init.py", line 2472, in require items = working_set.resolve(reqs, env, installer, extras=self.extras) File "/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages/pkg_resources/init.py", line 777, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (numpy 1.21.0 (/home/raymond/miniconda3/envs/genice-cif/lib/python3.9/site-packages), Requirement.parse('numpy==1.19.3'), {'GenIce2'})

The issue came up.

In addition to this numpy version issue, I'm not sure about the syntax of that genice2-cif plugin. In the manual, it says "genice2 cif[RHO.cif]". So there is no space between "cif" and "[", am I correct? And the RHO.cif is a CIF file in my current folder? Thanks a lot.

vitroid commented 3 years ago

GenIce2 specifies the version of numpy to 1.19.3 just because it is (perhaps) necessary to run it on Apple M1 (i.e. my machine), but it would be rather harmful to other people. I will update the PIP packages not to specify the version of numpy.

The syntax is correct. However, some shells might react to the brackets after "cif". You might better put quotation marks around the argument like this: genice2 'cif[RHO.cif]'.

vitroid commented 3 years ago

I removed the version specification for numpy and deployed to PyPI as ver. 2.1.2. I hope it works for you.

smutao commented 3 years ago

Thank you. The installation has no problem now.

smutao commented 2 years ago

Many thanks for providing this powerful tool to generate ice structures. Our paper utilizing GenIce is now published. https://pubs.acs.org/doi/10.1021/acs.jctc.1c00357