I have installed packages in pip3 but can't use that package in terminal.
For example:
pip3 install pgcli
% pgcli -h localhost -U name -d db
zsh: command not found: pgcli
But pgcli do is in my pip3 list.
I am using M2 chip.
I guessed it is because command line can't find the correct path, so I tried editing zshrc file.
export PYTHONPATH="/Users/peter/Library/Python/3.9/lib/python/site-packages:$PYTHONPATH"
, but it didn't work.
pip3 show pgcli
Name: pgcli
Version: 3.5.0
Summary: CLI for Postgres Database. With auto-completion and syntax highlighting.
Home-page: http://pgcli.com
Author: Pgcli Core Team
Author-email: [email protected]
License: BSD
Location: /Users/peter/Library/Python/3.9/lib/python/site-packages
Requires: cli-helpers, click, configobj, pendulum, pgspecial, prompt-toolkit, psycopg, Pygments, setproctitle, sqlparse
CodePudding user response:
The package's location is at site-packages
, but the executable is not in that location, and PYTHONPATH if for Python, not for your shell.
The fix for your zshrc:
path =('/Users/peter/Library/Python/3.9/bin')
export PATH