2

I am trying to install a work-in-progress package in a conda environment as an editable package via pip install -e, but I get a "no module named 'setuptools'", even though I have verified that setuptools is properly installed in the environment (I can import it in a python session inside the environment).

I have a minimal setup.py:

import setuptools

if __name__ == "__main__":
    setuptools.setup()

Any suggestions on how to fix this and install my package in an editable state? I also looked at this stack overflow question but did not find a suitable answer for my case.

Full error traceback below:

ERROR: Command errored out with exit status 1:
     command: /nfs/nhome/live/jbhagat/.conda/envs/aeon_env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/ceph/aeon/aeon/code/ProjectAeon/aeon/setup.py'"'"'; __file__='"'"'/ceph/aeon/aeon/code/ProjectAeon/aeon/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /ceph/aeon/aeon/code/ProjectAeon/aeon/
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'

Edit: Update: Interestingly, if I comment out all lines in my setup.py file I get the same error. If I delete my setup.py, I get an error stating that a setup.py is necessary to install an editable package.

jaib1
  • 327
  • 2
  • 12

1 Answers1

1

I'm still not sure exactly what's going on, but it appears to be pip related. These are two related situations I found:

1

2

My solution was just to use python setup.py develop instead of pip install -e : this sets up an .egg-link in my site-packages dir which points to my project code dir to allow for imports, which was good enough for me.

jaib1
  • 327
  • 2
  • 12