0

I’m having difficulty getting Python to find my pip installation of the module romodel. Here’s what I’ve done so far:

  1. Checked what my python path is using which python:

    /Users/<username>/opt/anaconda3/bin/python

  2. Used that to install using pip: /Users/<username>/opt/anaconda3/bin/python -m pip install romodel

  3. Uninstalled the existing one (which probably didn’t change anything): pip3 uninstall romodel

  4. Started python, and tried to find the romodel package:

    import romodel 
    
    Traceback (most recent call last): 
    
      File "<stdin>", line 1, in <module> 
    
    ModuleNotFoundError: No module named 'romodel' 
    
    
  5. I made sure that the romodel install location is in the path:

    ls /Users/<username>/opt/anaconda3/lib/python3.9/site-packages/ |grep "romodel"

    romodel-0.0.1.dist-info

  6. So, I start python and manually add the package location to the path:

    import sys

    sys.path.append('/Users/<username>/opt/anaconda3/lib/python3.9/site-packages/')

  7. However, still no module found:

    import romodel 
    
    Traceback (most recent call last): 
    
      File "<stdin>", line 1, in <module> 
    
    ModuleNotFoundError: No module named 'romodel' 
    
    

Is there something obvious that I’m missing? Based on the resources listed below, I would have expected the above procedure to work.

I used the following resources:

And my own previous question: How to correctly uninstall numpy on MacOSX?

makansij
  • 9,303
  • 37
  • 105
  • 183
  • 1
    You uninstalled the package in step 3 and never installed it again (assuming `pip3` is part of the Anaconda installation as well). – chepner May 17 '22 at 17:58
  • I suppose I forgot to include that, but yes I re-installed it using `pip3 install romodel`. This should go between steps 3 and 4. But anyway, step 5 shows that the directory is still there regardless. – makansij May 17 '22 at 20:59
  • 1
    That fact that *only* the `dist-info` directory is there, rather than a directory named `romodel` or a file named `romodel.py`, is suspicious. That directory only holds *metadata about* (I think) the distribution package, not the Python package itself. – chepner May 18 '22 at 00:51

1 Answers1

0

Per the instructions here: https://pypi.org/project/romodel/, I was mistakenly trying to install romodel via pip install romodel. As of May 2022, that isn't how one should install romodel.

However, the correct way to install romodel is to follow the instructions here: https://github.com/cog-imperial/romodel:

pip install git+https://github.com/cog-imperial/romodel.git

makansij
  • 9,303
  • 37
  • 105
  • 183