如何修复这个python依赖关系?

2024-05-15 21:08:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚下载了greenplum for os x。当我试图启动数据库时,我得到了这个错误——我认为这意味着它缺少gppylib。在

/usr/local/greenplum$ bin/gpstart
Traceback (most recent call last):
  File "bin/gpstart", line 9, in <module>
    from gppylib.mainUtils import *
ImportError: No module named gppylib.mainUtils

以下是导致错误的文件中的行:

^{pr2}$

我尝试pip install gppylib和{},但都找不到包。我在谷歌上找不到这个包。在

我是否正确地理解python正在寻找一个名为gppylib的包?如果是,我在哪里能找到它?在


Tags: 数据库mostforbinosusrlocal错误
2条回答

这对我很有效:

source $GPHOME/greenplum_path.sh

我能够重现错误,似乎路径没有设置为包括/usr/local/greenplum-db-4.2.2.4/lib/python/gppylib/mainUtils.py,这是我安装的包所在的位置。当我export PYTHONPATH=/usr/local/greenplum-db-4.2.2.4/lib/python/时,我收到了另一条错误消息:

Error: unable to import module: dlopen(/usr/local/greenplum-db-4.2.2.4/lib/python/pygresql/_pg.so, 2): no suitable image found.  Did find:
    /usr/local/greenplum-db-4.2.2.4/lib/python/pygresql/_pg.so: mach-o, but wrong architecture

我怀疑这是因为pygresql是为32位体系结构编译的,而我使用的是x86_64(与您首先找不到gppylib的问题无关):

^{2}$

还请注意自述中说:


REQUIRED OS SYSTEM SETTINGS FOR GREENPLUM DATABASE


These must be set on all Greenplum hosts (master and segments). Make sure you restart your system after adding or changing kernel parameters.

Add all of the following to /etc/sysctl.conf:

kern.sysv.shmmax=2147483648

kern.sysv.shmmin=1

kern.sysv.shmmni=64

kern.sysv.shmseg=16

kern.sysv.shmall=524288

kern.maxfiles=65535

kern.maxfilesperproc=65535

net.inet.tcp.msl=60

If using DHCP, add the following line to /etc/hostconfig:

HOSTNAME=""

You would then use this host name when exchanging ssh keys and when initializing your Greenplum Database system.


POST INSTALLATION STEPS


These are the high-level steps to configure and initialize a new Greenplum Database instance. For detailed instructions, please see the 'Greenplum Database Installation Guide' available for download from http://powerlink.emc.com

  1. Allocate a 'gpadmin' OS user to own and run your installation. This user must exist on all Greenplum hosts.

  2. Source the greenplum_path.sh file in your 'gpadmin' user profile (.bashrc) of your master host. This sets the environment variables needed by Greenplum Database.

  3. Use the gpseginstall utility to install and configure the Greenplum software on all hosts.

  4. Create your data directory locations on all Greenplum hosts.

  5. Use the gpinitsystem utility on the master host to initialize and start your Greenplum Database system. This utility requires a configuration file and a host file. For example:

    gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem

    A sample multi-node initialization configuration file can be found in $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config. Edit the example files to reflect your desired Greenplum Database configuration.


ABOUT YOUR INSTALLATION


The Greenplum Database installer installs the following files and directories:

  • greenplum_path.sh - Greenplum Database environment variables.

  • GPDB-LICENSE.txt - Greenplum license agreement.

  • LICENSE.thirdparty - Licenses for third-party tools

  • bin - Greenplum Database server programs, client programs, and management tools.

  • demo - Greenplum Database demonstration programs.

  • docs - Greenplum Database documentation.

  • etc - Sample configuration file for OpenSSL.

  • ext - Bundled programs (such as Python) used by some Greenplum Database utilies.

  • include - Greenplum Database and PostgreSQL header files.

  • lib - Greenplum Database and PostgreSQL library files.

  • sbin - Supporting/Internal scripts and programs.

  • share - PostgreSQL sample files and templates.


GREENPLUM DATABASE DOCUMENTATION


The following documentation is available for download from http://powerlink.emc.com:

(All Greenplum Database Installations)

  • GPDB README.pdf - Release notes for this version of Greenplum Database

  • GPInstallGuide.pdf - Greenplum Database Installation Guide

  • GPAdminGuide.pdf - Greenplum Database Administrator Guide

  • GPPerfmonAdminGuide.pdf - Greenplum Performance Monitor Administrator Guide

相关问题 更多 >