Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda installation doesn't work out of the box - ModuleNotFoundError psycopg2 #1552

Open
ligerzero-ai opened this issue Jul 24, 2024 · 2 comments · May be fixed by #1553
Open

conda installation doesn't work out of the box - ModuleNotFoundError psycopg2 #1552

ligerzero-ai opened this issue Jul 24, 2024 · 2 comments · May be fixed by #1553
Labels
bug Something isn't working

Comments

@ligerzero-ai
Copy link
Contributor

mamba install -c conda-forge pyiron_workflow pyiron_atomistics pyiron_base

Attempting to import

from pyiron_atomistics.vasp.output import parse_vasp_output as pvo

results in:

Traceback (most recent call last):
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/database/generic.py", line 198, in __init__
    self._engine = create_engine(
                   ^^^^^^^^^^^^^^
  File "<string>", line 2, in create_engine
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned
    return fn(*args, **kwargs)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/sqlalchemy/engine/create.py", line 599, in create_engine
    dbapi = dbapi_meth(**dbapi_args)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 690, in import_dbapi
    import psycopg2
ModuleNotFoundError: No module named 'psycopg2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/cmmc/u/hmai/github_dev_pyiron/pyiron_vasp_nodes/min_example.py", line 7, in <module>
    from pyiron_atomistics.vasp.output import parse_vasp_output as pvo
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_atomistics/__init__.py", line 1, in <module>
    from pyiron_base import JOB_CLASS_DICT, Notebook, install_dialog
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/__init__.py", line 5, in <module>
    from pyiron_base.state import state
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/state/__init__.py", line 17, in <module>
    from pyiron_base.database.manager import database as _database
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/database/manager.py", line 255, in <module>
    database = DatabaseManager()
               ^^^^^^^^^^^^^^^^^
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_snippets/singleton.py", line 21, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/database/manager.py", line 31, in __init__
    self.open_connection()
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/database/manager.py", line 126, in open_connection
    self._database = DatabaseAccess(
                     ^^^^^^^^^^^^^^^
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/database/generic.py", line 212, in __init__
    raise ValueError("Connection to database failed: " + str(except_msg))
ValueError: Connection to database failed: No module named 'psycopg2'
Exception ignored in: <function DatabaseAccess.__del__ at 0x154009dac220>
Traceback (most recent call last):
  File "/cmmc/ptmp/hmai/mambaforge/envs/pyiron_workflow/lib/python3.12/site-packages/pyiron_base/database/generic.py", line 371, in __del__
    self.conn.close()
    ^^^^^^^^^
AttributeError: 'DatabaseAccess' object has no attribute 'conn'
@ligerzero-ai ligerzero-ai added the bug Something isn't working label Jul 24, 2024
@jan-janssen
Copy link
Member

This depends on your ~/.pyiron file. By default pyiron uses SQLite, on the Cluster we use PostgreSQL, but using PostgreSQL comes with the additional requirement to install psycopg2.

@jan-janssen jan-janssen transferred this issue from pyiron/pyiron Jul 25, 2024
@pmrv
Copy link
Contributor

pmrv commented Jul 25, 2024

We should still wrap this in an ImportAlarm somehwere.

@jan-janssen jan-janssen linked a pull request Jul 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants