1

How to Fix Entry Point Not Found while installing libraries in conda environment

Here I followed the topic above with quite same problem with amount of different details.

First, this is problem I found, indicated there are something wrong with _version_cpd.pyd file

enter image description here

when import torch-sparse into jupyter notebook.

import numpy as np
import pandas as pd
import networkx as nx
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch_scatter
from torch_geometric.data import Data
print(torch.__version__)

Details on errors reveals that could have some problem with loading dll path:

File ~\Miniconda3\envs\torchenv\lib\site-packages\torch_scatter\__init__.py:16, in <module>
     14 spec = cuda_spec or cpu_spec
     15 if spec is not None:
---> 16     torch.ops.load_library(spec.origin)
     17 elif os.getenv('BUILD_DOCS', '0') != '1':  # pragma: no cover
     18     raise ImportError(f"Could not find module '{library}_cpu' in "
     19                       f"{osp.dirname(__file__)}")

File ~\Miniconda3\envs\torchenv\lib\site-packages\torch\_ops.py:110, in _Ops.load_library(self, path)
    105 path = torch._utils_internal.resolve_library_path(path)
    106 with dl_open_guard():
    107     # Import the shared library into the process, thus running its
    108     # static (global) initialization code in order to register custom
    109     # operators with the JIT.
--> 110     ctypes.CDLL(path)
    111 self.loaded_libraries.add(path)

File ~\Miniconda3\envs\torchenv\lib\ctypes\__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    371 self._FuncPtr = _FuncPtr
    373 if handle is None:
--> 374     self._handle = _dlopen(self._name, mode)
    375 else:
    376     self._handle = handle

So after review the above topic, I found that the problem quite the same in which need to fix 2 files and make anaconda (my case is mini one) distribution. I think this is due to the conflict of 2 same files from particular environment and general.

The first location:

enter image description here

The second location:

enter image description here

So I might know the symptom but I dont know how to fix this (or whether I should do the same solution as topic on the top).

I use python 3.8, torch 1.10.2, None Cuda.

1 Answers1

1

I figure out the reason causing this problem due to problem of installing pytorch, torch-scatter and torch-sparse for cuda version, which is outside the enviroment. This leads to the conflict with same file of cpu version inside of environment.

I tried with new environment, not worked. Delete the installation of those package with conda, not worked.

After figure out the problem, which is listed in the threat:

https://github.com/pyg-team/pytorch_geometric/issues/3430

My step is: deleted current environment, uninstall those mentioned package (check with both pip and conda command) out of environment

Install with new environment from side:

conda install pytorch torchvision torchaudio cpuonly -c pytorch

pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.12.0+cpu.html

Make sure you are using same version of pytorch and same version of cude (or only cpu in my case)