qzhu2017 / XRD

X-ray diffraction calculations
MIT License
7 stars 6 forks source link

Import Errors #35

Closed sabaronett closed 3 years ago

sabaronett commented 3 years ago

Steps to reproduce

  1. Create fresh conda venv w/ Python 3.8.1 (last known working version of VXRD);
  2. Followed README.md instructions to install requirements.txt;
  3. Ran Flask w/ flask run

Error

 * Serving Flask app "vxrd.py"
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
Usage: flask run [OPTIONS]

Error: While importing "vxrd", an ImportError was raised:

Traceback (most recent call last):
  File "/home/stanley/miniconda3/envs/xrd/lib/python3.8/site-packages/flask/cli.py", line 240, in locate_app
    __import__(module_name)
  File "/home/stanley/github/sabaronett/XRD/flask/vxrd.py", line 1, in <module>
    from app import app
  File "/home/stanley/github/sabaronett/XRD/flask/app/__init__.py", line 16, in <module>
    from app import routes, errors
  File "/home/stanley/github/sabaronett/XRD/flask/app/routes.py", line 8, in <module>
    from pyxtal_xrd.XRD import XRD
ModuleNotFoundError: No module named 'pyxtal_xrd'
sabaronett commented 3 years ago

@qzhu2017, I'm having trouble resolving this issue with relative import statements. Maybe you have some insight or can help.

sabaronett commented 3 years ago

By the way, it still works in my older conda virtual environment which explicitly had pyxtal-xrd installed from PyPI, back when it was still available:

(vxrd) stanley@PAVILION-13:~/github/sabaronett/XRD/flask$ pip list
Package         Version
--------------- -------------------
...
pyxtal-xrd      0.0.2
sabaronett commented 3 years ago

@qzhu2017, never mind; I forgot to run setup.py in root first—it's working now.

I'll update README.md per #31 and close this issue.

sabaronett commented 3 years ago

As the (V)XRD project has merged into PyXtal, resolved in https://github.com/qzhu2017/PyXtal/commit/43fc4a02cd284c41ed45613bbd232bf6c61f00b2. See also #31 and 9258e4845dd8cc3d5326eb41604309d57f453d27 for add'l info.

Closing issue.