stanfordnqp/spins-b

bend90.py fails to run

Closed this issue · 4 comments

Summary:
Running bend90.py results in a missing module error due to a missing init file. Adding the init file solves the issue. See #65.

Steps to reproduce:

  1. Git clone most recent master branch 9cd1510.
  2. Install using: pip install ./spins-b
  3. Change directory to examples/goos/bend90.
  4. Try to run bend90: python bend90.py
  5. Error message: ModuleNotFoundError: No module named 'spins.goos_sim'
snapo commented

same issue...

@snapo @jonbenfri Maybe try (if linux) "ln -s /path/to/spins-b/spins ." before running "python bend90.py".

The solution that worked for me was to create empty files named __init__.py and place them in the appropriate directories. In Linux you can create the empty files as follows:

cd /path/to/spins-b
touch spins/__init__.py
touch spins/goos_sim/__init__.py

I submitted a pull request for the solution here: #65

Fixed by #73. Tested using system-wide Python 3.9.7 on Ubuntu 21.10.