在VP上设置Python环境时出现的问题

2024-09-27 00:11:29 发布

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

我试图在我的VPS上设置一个Python环境来运行我编写的Python脚本。这是我第一次尝试这样的事情。我需要安装两个库,所以我试图通过上传tar文件、解压缩并运行python setup.py install来安装pip,但是我得到一个错误,说没有安装setuptools,所以为了安装,我上传了正确的egg并运行了sh setuptools-0.6c11-py2.6.egg,但是我收到一个错误,说没有安装zlib,所以我上传了tar文件并解压缩并尝试以下操作:

[nabusman@host zlib-1.2.6]$ ./configure --prefix=/usr/local/zlib
Checking for gcc...
Checking for shared library support...
No shared library support.
Building static library libz.a version 1.2.6 with cc.
Checking for off64_t... No.
Checking for fseeko... No.
Checking for unistd.h... No.
Checking for stdarg.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf().
Checking for snprintf() in stdio.h... No.
  WARNING: snprintf() not found, falling back to sprintf(). zlib
  can build but will be open to possible buffer-overflow security
  vulnerabilities.
Checking for return value of sprintf()... No.
  WARNING: apparently sprintf() does not return a value. zlib
  can build but will be open to possible string-format security
  vulnerabilities.
[nabusman@host zlib-1.2.6]$ make
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -I. -c -o example.o test/example.c
make: execvp: cc: Permission denied
make: *** [example.o] Error 127
[nabusman@host zlib-1.2.6]$ make -n
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -I. -c -o example.o test/example.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o adler32.o adler32.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o crc32.o crc32.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o deflate.o deflate.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o infback.o infback.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o inffast.o inffast.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o inflate.o inflate.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o inftrees.o inftrees.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o trees.o trees.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o zutil.o zutil.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o compress.o compress.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o uncompr.o uncompr.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o gzclose.o gzclose.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o gzlib.o gzlib.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o gzread.o gzread.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void   -c -o gzwrite.o gzwrite.c
ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 
(ranlib libz.a || true) >/dev/null 2>&1
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -o example example.o -L. libz.a
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -I. -c -o minigzip.o test/minigzip.c
cc -O -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -o minigzip minigzip.o -L. libz.a
[nabusman@host zlib-1.2.6]$

所以我现在有点迷路了。我不明白这些错误,也不知道发生了什么。除了这个问题的解决方案,有没有几本书/网站可以让我了解这里发生的事情?在

注: VPS正在运行CentOS 5

谢谢。在


Tags: nohostforexamplecccheckingzlibvoid

热门问题