โค้ด: เลือกทั้งหมด
import psycopg2 as p
ผมจึงไปติดตั้ง module ใน terminal โดยใช้คำสั่งimport psycopg2 as p
ImportError: No module named 'psycopg2'
โค้ด: เลือกทั้งหมด
pip3 install psycopg2
ตรงนี้ต้องแก้ยังไงครับcom003@com003-K45A:~/Downloads/tool_selenium_for_read_thread-master$ pip3 install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages ... 8.6.tar.gz
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'
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-62pwj1ab/psycopg2/
You are using pip version 8.1.1, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
com003@com003-K45A:~/Downloads/tool_selenium_for_read_thread-master$ pip3 install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages ... 8.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-q749752s/psycopg2/
You are using pip version 8.1.1, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.