โค้ด: เลือกทั้งหมด
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
Moderator: mindphp, ผู้ดูแลกระดาน
โค้ด: เลือกทั้งหมด
C:\Python27>python D:\update_seq.py
โค้ด: เลือกทั้งหมด
pip install psycopg2
โค้ด: เลือกทั้งหมด
python get-pip.py
โค้ด: เลือกทั้งหมด
python -m pip -V
โค้ด: เลือกทั้งหมด
python -m pip install psycopg2
โค้ด: เลือกทั้งหมด
C:\Python27>python -m pip install psycopg2
โค้ด: เลือกทั้งหมด
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.
โค้ด: เลือกทั้งหมด
python -m pip install --upgrade pip
โค้ด: เลือกทั้งหมด
python -m pip install psycopg2
C:\Python27>python -m pip install --upgrade pip
โค้ด: เลือกทั้งหมด
Collecting pip
Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
100% |################################| 1.4MB 335kB/s
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Successfully uninstalled pip-7.1.2
โค้ด: เลือกทั้งหมด
C:\Python27>python -m pip install psycopg2
โค้ด: เลือกทั้งหมด
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting psycopg2
Downloading psycopg2-2.8.5-cp27-cp27m-win_amd64.whl (1.1 MB)
|################################| 1.1 MB 882 kB/s
Installing collected packages: psycopg2
Successfully installed psycopg2-2.8.5
โค้ด: เลือกทั้งหมด
C:\Python27>python D:\update_seq.py
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 98