Code: Select all
C:\Python27>python D:\update_seq.py
File "D:\update_seq.py", line 5, in <module>
import psycopg2 as p ,configparser
ImportError: No module named psycopg2
Moderators: mindphp, ผู้ดูแลกระดาน
Code: Select all
C:\Python27>python D:\update_seq.py
Code: Select all
pip install psycopg2
Code: Select all
python get-pip.py
Code: Select all
python -m pip -V
Code: Select all
python -m pip install psycopg2
Code: Select all
C:\Python27>python -m pip install psycopg2
Code: Select all
Collecting psycopg2
Downloading https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz (380kB)
100% |################################| 380kB 1.0MB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\psycopg2.egg-info
writing pip-egg-info\psycopg2.egg-info\PKG-INFO
writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt
writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt'
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\m017\appdata\local\temp\pip-build-vxglvm\psycopg2
You are using pip version 7.1.2, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Code: Select all
python -m pip install --upgrade pip
Code: Select all
python -m pip install psycopg2
Users browsing this forum: No registered users and 5 guests