acoustid / mbdata

MusicBrainz SQLAlchemy Models
MIT License
97 stars 23 forks source link

No module named 'psycopg2' #50

Closed guisil closed 1 year ago

guisil commented 2 years ago

I'm trying to follow the instructions in a raspberry pi with ubuntu 22.04.

Once I get to part 5 of the instructions it always fails at the first command.

Traceback (most recent call last): File "/home/ubuntu/.local/bin/mbslave", line 5, in <module> from mbdata.replication import main File "/home/ubuntu/.local/pipx/venvs/mbdata/lib/python3.10/site-packages/mbdata/replication.py", line 7, in <module> import psycopg2 ModuleNotFoundError: No module named 'psycopg2'

I tried to install psycopg2 in several ways (installing psycopg2-binary using pip and pip3, building from the source and installing it), and in all those times the installation was successful. However, those mbslave commands always end up not finding the module.

What am I missing here?

BriantOliveira commented 2 years ago

Interesting, I just ran into this issue and It looks like you need to install psycopg2, try pip install psycopg2==2.8.5, I ran this command and it worked for me. How did you install mbslave?

NoNamePro0 commented 2 years ago

First installing using pipx it doesn't worked. Even by having psycopg2 installed. However by installing mbdata over my system package manager and uninstalling pipx it worked.

osamsam321 commented 2 years ago

Make sure you have the psycop2 folders installed into the correct directory:

         /home/<<user>>/.local/pipx/venvs/mbdata/lib/python3.10/site-packages

I had the folders installed in the wrong directory ( /home/<>/.local/lib/python3.10/site-packages).

wdlbrmft commented 2 years ago

I had a hard time figuring this out. IMHO the Install guide should point out a way to install this dependency. I'd suggest installing it into the venv with pipx: pipx inject psycopg2

nryberg commented 1 year ago

Make sure you have the psycop2 folders installed into the correct directory:

         /home/<<user>>/.local/pipx/venvs/mbdata/lib/python3.10/site-packages

I had the folders installed in the wrong directory ( /home/<>/.local/lib/python3.10/site-packages).

pipx lets you load libraries on a per app basis - this worked for me:

pipx inject mbdata psycopg2

lalinsky commented 1 year ago

How exactly did you guys install it initially? In the README file, it says to use pipx install mbdata[replication]. The [replication] tag make is require psycopg2 on install. Did you just run pipx install mbdata?

lalinsky commented 1 year ago

Closing this one, it should work fine if you are following the instructions exactly.

nryberg commented 1 year ago

I followed the directions, and the package didn't get installed. Easy fix though.

On Tue, Nov 29, 2022 at 6:30 AM Lukáš Lalinský @.***> wrote:

How exactly did you guys install it initially? In the README file, it says to use pipx install mbdata[replication]. The [replication] tag make is require psycopg2 on install. Did you just run pipx install mbdata?

— Reply to this email directly, view it on GitHub https://github.com/acoustid/mbdata/issues/50#issuecomment-1330559207, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALIVKM7EZNQFPRT7X73ZTWKXZNFANCNFSM5Y7M42LQ . You are receiving this because you commented.Message ID: @.***>

-- Nick Ryberg