conda-forge / rdkit-feedstock

A conda-smithy repository for rdkit.
BSD 3-Clause "New" or "Revised" License
8 stars 22 forks source link

rdkit says it's installed but it is not available #120

Closed fxcoudert closed 1 year ago

fxcoudert commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

I am creating a conda-forge environment based on this file:

$ cat environment.yml                          
name: binder-environment
channels:
  - conda-forge
dependencies:
  # Enforce Python version
  - python=3.11

  # Scientific python
  - networkx
  - numpy
  - openpyxl
  - pandas
  - scipy

  # Plotting
  - ipympl
  - matplotlib-base
  - plotly
  - seaborn

  # Machine learning
  - scikit-learn

  # Chemistry
  - mordred
  - rdkit

  # Install some things through pip
  - pip
  - pip:
    # Materials Project
    - mp_api
    - mpcontribs-client

with conda env create -f environment.yml -n ML2023. conda is happy and exits with success. I activate the env with conda activate ML2023. I now have:

$ conda list rdkit
# packages in environment at /Users/fx/miniforge3/envs/ML2023:
#
# Name                    Version                   Build  Channel
rdkit                     2022.09.3       py311h912b5b5_0    conda-forge

but:

$ python3
Python 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:21:25) [Clang 14.0.4 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdkit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'rdkit'

This says I have a python 3.11 version of rdkit, but it cannot be found.

Installed packages

# packages in environment at /Users/fx/miniforge3/envs/ML2023:
#
# Name                    Version                   Build  Channel
anyio                     3.6.2              pyhd8ed1ab_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
appnope                   0.1.3              pyhd8ed1ab_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py311he2be06e_3    conda-forge
arrow                     1.2.3                    pypi_0    pypi
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
attrs                     22.2.0             pyh71513ae_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.11.1             pyha770c72_0    conda-forge
bleach                    5.0.1              pyhd8ed1ab_0    conda-forge
boltons                   21.0.0                   pypi_0    pypi
boost                     1.78.0          py311h5c64717_4    conda-forge
boost-cpp                 1.78.0               h1cb353e_1    conda-forge
bravado                   11.0.3                   pypi_0    pypi
bravado-core              5.17.1                   pypi_0    pypi
brotli                    1.0.9                h1a8c8d9_8    conda-forge
brotli-bin                1.0.9                h1a8c8d9_8    conda-forge
brotlipy                  0.7.0           py311he2be06e_1005    conda-forge
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
cairo                     1.16.0            h73a0509_1014    conda-forge
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py311hae827db_3    conda-forge
charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.1.2              pyhd8ed1ab_0    conda-forge
contourpy                 1.0.6           py311hd6ee22a_0    conda-forge
cryptography              39.0.0          py311h507f6e9_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
debugpy                   1.6.5           py311ha397e9f_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
dnspython                 2.2.1                    pypi_0    pypi
emmet-core                0.39.6                   pypi_0    pypi
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hb7217d7_0    conda-forge
filetype                  1.2.0                    pypi_0    pypi
flatten-dict              0.4.2                    pypi_0    pypi
flit-core                 3.8.0              pyhd8ed1ab_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.1               h82840c6_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.38.0          py311he2be06e_1    conda-forge
fqdn                      1.5.1                    pypi_0    pypi
freetype                  2.12.1               hd633e50_1    conda-forge
future                    0.18.2                   pypi_0    pypi
gettext                   0.21.1               h0186832_0    conda-forge
greenlet                  2.0.1           py311ha397e9f_0    conda-forge
icu                       70.1                 h6b3803e_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
importlib-metadata        6.0.0              pyha770c72_0    conda-forge
importlib_resources       5.10.2             pyhd8ed1ab_0    conda-forge
ipykernel                 6.19.4             pyh736e0ef_0    conda-forge
ipympl                    0.9.2              pyhd8ed1ab_0    conda-forge
ipython                   8.8.0              pyhd1c38e8_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.7.2              pyhd8ed1ab_0    conda-forge
isoduration               20.11.0                  pypi_0    pypi
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
joblib                    1.2.0              pyhd8ed1ab_0    conda-forge
jpeg                      9e                   he4db4b2_2    conda-forge
json2html                 1.3.0                    pypi_0    pypi
jsonpointer               2.3                      pypi_0    pypi
jsonref                   1.0.1                    pypi_0    pypi
jsonschema                4.17.3             pyhd8ed1ab_0    conda-forge
jupyter_client            7.4.8              pyhd8ed1ab_0    conda-forge
jupyter_core              5.1.2           py311h267d04e_0    conda-forge
jupyter_events            0.5.0              pyhd8ed1ab_1    conda-forge
jupyter_server            2.0.6              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.3              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        1.1.1              pyhd8ed1ab_0    conda-forge
kiwisolver                1.4.4           py311hd6ee22a_1    conda-forge
latexcodec                2.0.1                    pypi_0    pypi
lcms2                     2.14                 h481adae_1    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libblas                   3.9.0           16_osxarm64_openblas    conda-forge
libbrotlicommon           1.0.9                h1a8c8d9_8    conda-forge
libbrotlidec              1.0.9                h1a8c8d9_8    conda-forge
libbrotlienc              1.0.9                h1a8c8d9_8    conda-forge
libcblas                  3.9.0           16_osxarm64_openblas    conda-forge
libcxx                    14.0.6               h2692d47_0    conda-forge
libdeflate                1.14                 h1a8c8d9_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           11_3_0_hd922786_27    conda-forge
libgfortran5              11.3.0              hdaf2cc0_27    conda-forge
libglib                   2.74.1               h4646484_1    conda-forge
libiconv                  1.17                 he4db4b2_0    conda-forge
libjpeg-turbo             2.1.4                h1a8c8d9_0    conda-forge
liblapack                 3.9.0           16_osxarm64_openblas    conda-forge
libopenblas               0.3.21          openmp_hc731615_3    conda-forge
libpng                    1.6.39               h76d750c_0    conda-forge
libsodium                 1.0.18               h27ca646_1    conda-forge
libsqlite                 3.40.0               h76d750c_0    conda-forge
libtiff                   4.5.0                heb92581_0    conda-forge
libwebp-base              1.2.4                h57fd34a_0    conda-forge
libxcb                    1.13              h9b22ae9_1004    conda-forge
libzlib                   1.2.13               h03a7124_4    conda-forge
llvm-openmp               15.0.6               h7cfbb63_0    conda-forge
markupsafe                2.1.1           py311he2be06e_2    conda-forge
matplotlib-base           3.6.2           py311h99a5f44_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mistune                   2.0.4              pyhd8ed1ab_0    conda-forge
monotonic                 1.6                      pypi_0    pypi
monty                     2022.9.9                 pypi_0    pypi
mordred                   1.2.0                      py_1    conda-forge
mp-api                    0.30.5                   pypi_0    pypi
mpcontribs-client         5.0.7                    pypi_0    pypi
mpmath                    1.2.1                    pypi_0    pypi
msgpack                   1.0.4                    pypi_0    pypi
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
nbclassic                 0.4.8              pyhd8ed1ab_0    conda-forge
nbclient                  0.7.2              pyhd8ed1ab_0    conda-forge
nbconvert                 7.2.7              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.2.7              pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.2.7              pyhd8ed1ab_0    conda-forge
nbformat                  5.7.1              pyhd8ed1ab_0    conda-forge
ncurses                   6.3                  h07bb92c_1    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
networkx                  2.8.8              pyhd8ed1ab_0    conda-forge
notebook                  6.5.2              pyha770c72_1    conda-forge
notebook-shim             0.2.2              pyhd8ed1ab_0    conda-forge
numpy                     1.24.1          py311ha92fb03_0    conda-forge
openjpeg                  2.5.0                hbc2ba62_2    conda-forge
openpyxl                  3.0.10          py311he2be06e_2    conda-forge
openssl                   3.0.7                h03a7124_1    conda-forge
packaging                 22.0               pyhd8ed1ab_0    conda-forge
palettable                3.3.0                    pypi_0    pypi
pandas                    1.5.2           py311h4eec4a9_0    conda-forge
pandoc                    2.19.2               hce30654_1    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
patsy                     0.5.3              pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hb34f9b4_0    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.4.0           py311h6425a22_0    conda-forge
pint                      0.19.2                   pypi_0    pypi
pip                       22.3.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h27ca646_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              2.6.2              pyhd8ed1ab_0    conda-forge
plotly                    5.11.0             pyhd8ed1ab_1    conda-forge
pooch                     1.6.0              pyhd8ed1ab_0    conda-forge
prometheus_client         0.15.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.36             pyha770c72_0    conda-forge
psutil                    5.9.4           py311he2be06e_0    conda-forge
pthread-stubs             0.4               h27ca646_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pybtex                    0.24.0                   pypi_0    pypi
pycairo                   1.23.0          py311hd8c8ded_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydantic                  1.10.4                   pypi_0    pypi
pygments                  2.14.0             pyhd8ed1ab_0    conda-forge
pyisemail                 2.0.1                    pypi_0    pypi
pymatgen                  2022.11.7                pypi_0    pypi
pymongo                   4.3.3                    pypi_0    pypi
pyopenssl                 23.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
pyrsistent                0.19.3          py311he2be06e_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.0          h93c2e33_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.16.2             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.4              pyhd8ed1ab_0    conda-forge
python_abi                3.11                    3_cp311    conda-forge
pytz                      2022.7             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py311he2be06e_5    conda-forge
pyzmq                     24.0.1          py311h0f351f6_1    conda-forge
rdkit                     2022.09.3       py311h912b5b5_0    conda-forge
readline                  8.1.2                h46ed386_0    conda-forge
reportlab                 3.6.12          py311h0bcb684_2    conda-forge
requests                  2.28.1             pyhd8ed1ab_1    conda-forge
requests-futures          1.0.0                    pypi_0    pypi
rfc3339-validator         0.1.4                    pypi_0    pypi
rfc3987                   1.3.8                    pypi_0    pypi
ruamel-yaml               0.17.21                  pypi_0    pypi
scikit-learn              1.2.0           py311hba7d9bc_0    conda-forge
scipy                     1.10.0          py311h0bcca16_0    conda-forge
seaborn                   0.12.2               hd8ed1ab_0    conda-forge
seaborn-base              0.12.2             pyhd8ed1ab_0    conda-forge
semantic-version          2.10.0                   pypi_0    pypi
send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
setuptools                65.6.3             pyhd8ed1ab_0    conda-forge
simplejson                3.18.1                   pypi_0    pypi
six                       1.16.0             pyh6c4a22f_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
spglib                    2.0.2                    pypi_0    pypi
sqlalchemy                1.4.46          py311he2be06e_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
statsmodels               0.13.5          py311h4add359_2    conda-forge
swagger-spec-validator    3.0.3                    pypi_0    pypi
sympy                     1.11.1                   pypi_0    pypi
tabulate                  0.9.0                    pypi_0    pypi
tenacity                  8.1.0              pyhd8ed1ab_0    conda-forge
terminado                 0.17.1             pyhd1c38e8_0    conda-forge
threadpoolctl             3.1.0              pyh8a188c0_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               he1e0b03_0    conda-forge
tornado                   6.2             py311he2be06e_1    conda-forge
tqdm                      4.64.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.8.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.4.0                hd8ed1ab_0    conda-forge
typing_extensions         4.4.0              pyha770c72_0    conda-forge
tzdata                    2022g                h191b570_0    conda-forge
ujson                     5.6.0                    pypi_0    pypi
uncertainties             3.1.7                    pypi_0    pypi
uri-template              1.2.0                    pypi_0    pypi
urllib3                   1.26.13            pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webcolors                 1.12                     pypi_0    pypi
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.4.2              pyhd8ed1ab_0    conda-forge
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
widgetsnbextension        3.6.1              pyha770c72_0    conda-forge
xorg-libxau               1.0.9                h27ca646_0    conda-forge
xorg-libxdmcp             1.1.3                h27ca646_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
yaml                      0.2.5                h3422bc3_2    conda-forge
zeromq                    4.3.4                hbdafb3b_1    conda-forge
zipp                      3.11.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               h03a7124_4    conda-forge
zstd                      1.5.2                h8128057_4    conda-forge

Environment info

active environment : ML2023
    active env location : /Users/fx/miniforge3/envs/ML2023
            shell level : 2
       user config file : /Users/fx/.condarc
 populated config files : /Users/fx/miniforge3/.condarc
                          /Users/fx/.condarc
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.10.8.final.0
       virtual packages : __archspec=1=arm64
                          __osx=13.1=0
                          __unix=0=0
       base environment : /Users/fx/miniforge3  (writable)
      conda av data dir : /Users/fx/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/fx/miniforge3/pkgs
                          /Users/fx/.conda/pkgs
       envs directories : /Users/fx/miniforge3/envs
                          /Users/fx/.conda/envs
               platform : osx-arm64
             user-agent : conda/22.11.1 requests/2.28.1 CPython/3.10.8 Darwin/22.2.0 OSX/13.1
                UID:GID : 502:20
             netrc file : None
           offline mode : False
fxcoudert commented 1 year ago

For some unknown reason, the rdkit in my environment seems to be installed in:

$ ls ~/miniforge3/envs/ML2023/lib/python3.10/site-packages
rdkit  xcbgen
tentrillion commented 1 year ago

I'm having a similar issue. When I do ls ~/miniforge3/envs/rdkit/lib/python3.10/site-packages it says rdkit xcbgen as well. How did you resolve it?

I had been thinking it was some kind of M1 arm vs. intel issue.

bkpoon commented 1 year ago

I created a PR that should fix this issue (see above). You can test the packages built by the PR by downloading one of the osx-arm64 artifacts and unzipping that file. The conda package will be in the 'osx-arm64' directory. Then in your existing conda environment with rdkit, run

conda install rdkit-2022.09.3-<rest of filename>.conda

The import should work and you can check that the ${CONDA_PREFIX}/lib/<python version>/site-packages/rdkit exists for your Python version.

tentrillion commented 1 year ago

I fixed my particular issue (apologies for not commenting earlier) by downgrading to python 3.10. Looking forward to having a real fix though; thanks bkpoon!