Alexis-benoist / eralchemy

Entity Relation Diagrams generation tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fresh Homebrew can't find `psycopg2`

jjnypr opened this issue Β· comments

Environment

macOS 10.14.6

$ brew doctor
Your system is ready to brew.
$ brew --version
Homebrew 2.1.11

Steps to reproduce

  1. Install eralchemy via Homebrew
  2. Run eralchemy w/ postgresql+pscyopg2 url
  3. Enjoy cool new ERD pdf

Expected Result

Cool new ERD pdf

Actual Result

Errors relating to psycopg2:

LAPT-redactedusername-MAC:source:$ brew install eralchemy
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

==> Downloading https://homebrew.bintray.com/bottles/eralchemy-1.2.10_2.mojave.bottle.tar.gz
Already downloaded: /Users/redactedusername/Library/Caches/Homebrew/downloads/138ced36c6b040547d8324b7a1755d9c8cc373e282ea7ac53d45165f151b1e73--eralchemy-1.2.10_2.mojave.bottle.tar.gz
==> Pouring eralchemy-1.2.10_2.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/eralchemy/1.2.10_2: 784 files, 10.5MB
LAPT-redactedusername-MAC:source:$ eralchemy -i '[connection string]' -o erd.pdf
Traceback (most recent call last):
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 231, in render_er
    tables, relationships = all_to_intermediary(input, schema=schema)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 147, in all_to_intermediary
    return database_to_intermediary(filename_or_input, schema=schema)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/sqla.py", line 78, in database_to_intermediary
    engine = create_engine(database_uri)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 424, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 81, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 584, in dbapi
    import psycopg2
ModuleNotFoundError: No module named 'psycopg2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/eralchemy", line 11, in <module>
    load_entry_point('ERAlchemy==1.2.10', 'console_scripts', 'eralchemy')()
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 38, in cli
    schema=args.s
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 238, in render_er
    module_name = e.message.split()[-1]
AttributeError: 'ModuleNotFoundError' object has no attribute 'message'
LAPT-redactedusername-MAC:source:$ pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached https://files.pythonhosted.org/packages/ee/ed/2772267467ba5c21a73d37149da0b49a4343c6646d501dbb1450b492d40a/psycopg2_binary-2.8.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.3
LAPT-redactedusername-MAC:source:$ eralchemy -i '[connection string]' -o erd.pdf
Traceback (most recent call last):
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 231, in render_er
    tables, relationships = all_to_intermediary(input, schema=schema)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 147, in all_to_intermediary
    return database_to_intermediary(filename_or_input, schema=schema)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/sqla.py", line 78, in database_to_intermediary
    engine = create_engine(database_uri)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 424, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 81, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 584, in dbapi
    import psycopg2
ModuleNotFoundError: No module named 'psycopg2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/eralchemy", line 11, in <module>
    load_entry_point('ERAlchemy==1.2.10', 'console_scripts', 'eralchemy')()
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 38, in cli
    schema=args.s
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 238, in render_er
    module_name = e.message.split()[-1]
AttributeError: 'ModuleNotFoundError' object has no attribute 'message'
LAPT-redactedusername-MAC:source:$ pip install psycopg2
Collecting psycopg2
  Downloading https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz (377kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 378kB 6.2MB/s 
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... done
  Stored in directory: /Users/redactedusername/Library/Caches/pip/wheels/48/06/67/475967017d99b988421b87bf7ee5fad0dad789dc349561786b
Successfully built psycopg2
Installing collected packages: psycopg2
Successfully installed psycopg2-2.8.3
LAPT-redactedusername-MAC:source:$ eralchemy -i '[connection string]' -o erd.pdf
Traceback (most recent call last):
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 231, in render_er
    tables, relationships = all_to_intermediary(input, schema=schema)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 147, in all_to_intermediary
    return database_to_intermediary(filename_or_input, schema=schema)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/sqla.py", line 78, in database_to_intermediary
    engine = create_engine(database_uri)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 424, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 81, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 584, in dbapi
    import psycopg2
ModuleNotFoundError: No module named 'psycopg2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/eralchemy", line 11, in <module>
    load_entry_point('ERAlchemy==1.2.10', 'console_scripts', 'eralchemy')()
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 38, in cli
    schema=args.s
  File "/usr/local/Cellar/eralchemy/1.2.10_2/libexec/lib/python3.7/site-packages/eralchemy/main.py", line 238, in render_er
    module_name = e.message.split()[-1]
AttributeError: 'ModuleNotFoundError' object has no attribute 'message'```

I'm having the same issue as above, is there any fix for the issue above?

It does not have 'message' attribute, but has 'msg'. It indicates that required module is not installed. In your case it's psycopg2.