If you prefer to avoid building psycopg2 from source, please install the PyPIįor further information please check the 'doc/src/install.rst' file (also at Or with the pg_config option in 'setup.cfg'. Python setup.py build_ext -pg-config /path/to/pg_config build. Please add the directoryĬontaining pg_config to the $PATH or specify the full executable path with the Pg_config is required to build psycopg2 from source. Writing manifest file '/private/var/folders/00/0cr867qs7_lcp7b5h323321r0000gn/T/pip-pip-egg-info-0kxer1_o/psycopg2_binary.egg-info/SOURCES.txt' Writing top-level names to /private/var/folders/00/0cr867qs7_lcp7b5h323321r0000gn/T/pip-pip-egg-info-0kxer1_o/psycopg2_binary.egg-info/top_level.txt Writing dependency_links to /private/var/folders/00/0cr867qs7_lcp7b5h323321r0000gn/T/pip-pip-egg-info-0kxer1_o/psycopg2_binary.egg-info/dependency_links.txt × python setup.py egg_info did not run successfully.Ĭreating /private/var/folders/00/0cr867qs7_lcp7b5h323321r0000gn/T/pip-pip-egg-info-0kxer1_o/psycopg2_binary.egg-info Using cached psycopg2-binary-2.9.3.tar.gz (380 kB) In /Users/user/opt/miniconda3/envs/dat/lib/python3.7/site-packages/psycopg2/_įollowing this thread, this finally worked: brew install libpq -build-from-sourceĮxport LDFLAGS="-L/opt/homebrew/opt/libpq/lib"īefore using that, uninstall psycopg2 and psycopg2-binary: pip uninstall psycopg2-binary Referenced from: /Users/user/opt/miniconda3/envs/dat/lib/python3.7/site-packages/psycopg2/_ ImportError: dlopen(/Users/user/opt/miniconda3/envs/dat/lib/python3.7/site-packages/psycopg2/_, 2): Symbol not found: _PQbackendPID I encountered the following error while running a django command: Traceback (most recent call last):įile "/Users/user/opt/miniconda3/envs/dat/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 25, in įile "/Users/user/opt/miniconda3/envs/dat/lib/python3.7/site-packages/psycopg2/_init_.py", line 51, in In my case those were located in these folders: that to $PATH: export PATH=$PATH:/opt/homebrew/Cellar/postgresql/13.3/bin/pg_configĮxport run: pip install psycopg2. If you already have openssl installed, run: brew reinstall opensslįind the path of pg_config and openssl: which pg_config Pg_ctl -D /opt/homebrew/var/postgres start Install PostgreSQL, start the deamon and install openssl: brew install postgresql Or specify the full executable path with the option (.) zshrc to update the PATH on terminal startup.Error while installing through pip install psycopg2 looks like this: Please add the directory containing pg_config to the PATH I followed the instructions on the Brew Homepage. In my case homebrew was installed in /opt/homebrew by default. So I removed the pyenv install and went the brew install of Python 3.9.1 and here are the steps I used to get them the modules I wanted installed and working.įirst thing I noticed with this installation is that everything ends up in /opt/homebrew and you will need to add directories to your path. Most of the solutions I found did not seem to help and maybe I did not do the right things. I removed both and tired just pyenv by itself and got lots of errors with matplotlib, pandas, and psycopg2. I did find that you do not want to mix the two. I found two ways to install Python 3.9, one using pyenv and one using brew. The M1 with Big Sur comes with Python 2.7 and you do not want to replace it. This was interesting as I wanted at least Python 3.8+ and for the M1 it seemed that 3.9.1 was the first real supported release. Microsoft VS Code went in smoothly and synced everything once connected to my Microsoft account. The first steps were getting the development environment up and running. I do use a laptop for photography work as well. The work I do is Python, ansible, and other miscellaneous development projects connecting to databases, lately PostgreSQL. It is a MacBook Pro 13" M1, great little machine with lots of power.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |