Griddly icon indicating copy to clipboard operation
Griddly copied to clipboard

Conda: ModuleNotFoundError: No module named 'python_griddly'

Open gabegrand opened this issue 1 year ago • 2 comments

I'm trying to build a clean conda environment with Griddly manually installed from the repo. (The latest griddly version on PyPI is 1.6.7, which has some incompatibilities with gymnasium -- and I still have the Apple Silicon / Vulkan error from #286 which I'm hoping to resolve soon.)

I've spent a couple hours on this but still can't get past what seems to be a path error.

Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:39:40) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import griddly
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/grandg/mit/Griddly/python/griddly/__init__.py", line 16, in <module>
    gd = importlib.import_module("python_griddly")
  File "/opt/anaconda3/envs/gridtheory/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'python_griddly'

I tried the os.environ['PYTHONPATH'] hack from #126, but it didn't resolve the issue.

Minimal steps to reproduce:

  1. conda create -n griddly python=3.10
  2. conda activate griddly
  3. Follow manual build instructions from README
  4. python -m pip install -e .
  5. import griddly in Python interpreter

gabegrand avatar Aug 29 '23 22:08 gabegrand

Hey @Bam4d, thanks for the heads-up about the switch to poetry! Unfortunately, even after running poetry install and activating the environment with poetry shell, I'm still getting the above error. I've tried both installing within a pre-existing conda environment, and also installing on top of my base conda environment.

I noticed that even with the griddly poetry environment activated, poetry show reveals that griddly is not in the list of installed packages.

Do you have any suggestions? I'm pretty new to poetry so I'm not sure if I might be missing something.

gabegrand avatar Sep 01 '23 20:09 gabegrand

I was hitting this with python 3.10 on my mac, but it went away when i switched to python 3.11

daveey avatar Feb 11 '24 04:02 daveey