wengong-jin / hgraph2graph

Hierarchical Generation of Molecular Graphs using Structural Motifs
MIT License
367 stars 108 forks source link

Getting error while running pip install . #39

Open Shredderroy opened 2 years ago

Shredderroy commented 2 years ago

Hi,

I installed all the dependencies via conda in an environment called jtvae. Then, after cloning the repository, I ran:

(jtvae) hgraph2graph$ pip install .

But I got the following error:

Processing /home/homedir/projects/repos/hgraph2graph
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      error: Multiple top-level packages discovered in a flat-layout: ['data', 'ckpt', 'props', 'hgraph', 'polymers', 'val_scripts'].

      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.

      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:

      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

      To find more information, look for "package discovery" on setuptools docs.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(jtvae) hgraph2graph$

Any idea what might be going on? I am running Ubuntu 22.04.

viko-3 commented 2 years ago

I have the same problem.

roselightheart commented 2 years ago

try adding py_modules=['hgraph'] to your setup.py, it should look like:

from setuptools import find_packages, setup

setup(
    name='hgraph2graph',
    author='Wengong Jin',
    py_modules=['hgraph']
)
Shredderroy commented 2 years ago

@roselightheart thank you! That appears to have solved the problem.