帮助:Python2.3& RHEL4 x86_64上的Python2.4 [英] Help: Python2.3 & Python2.4 on RHEL4 x86_64

查看:119
本文介绍了帮助:Python2.3& RHEL4 x86_64上的Python2.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RHEL自带Python2.3。我需要安装的程序

需要Python2.4


所以我从源代码获得了Python2.4并进行了编译。我使用--prefix = / usr --exec-prefix = / usr和--enable-unicode = ucs4将其配置为
。我

然后make''d它然后make altinstall以便它没有覆盖

/ usr / bin / Python链接到/ usr / bin / Python2 .3。


好​​吧,出于某种原因,在/usr/lib64/Python2.4中没有正确放置拱门相关文件

,而是去了

/usr/lib/Python2.4。


另外,当我试图加载pysqlite时:

$ Python2 .4


>>来自pysqlite2 import test



我得到以下追溯:


回溯(最近一次调用最后一次):

文件setup.py,第24行,在?

导入glob,os,re,sys

文件" /usr/lib64/python2.3/glob .py",第4行,在?

import fnmatch

文件" /usr/lib64/python2.3/fnmatch.py​​" ;,第13行,在?

导入重新

文件" /usr/lib64/python2.3/re.py" ;,第5行,在?

来自sre import *

文件" / usr / lib64 / python2 .3 / sre.py",第97行,在?

import sre_compile

文件" /usr/lib64/python2.3/sre_compile.py" ;,第17行,在?

断言_sre.MAGIC == MAGIC,SRE模块不匹配

AssertionError:SRE模块不匹配


这对我来说基本上意味着Python2.4正在从/usr/lib/Python2.4的

/usr/lib64/Python2.3 insead中加载gloab.py(甚至认为我

想在/usr/lib64/Python2.4中安装相关文件。


有人可以帮忙!


尊重,

克里斯托弗·泰勒

解决方案

Python2.4


>>来自pysqlite2 import test



I ge以下回溯:


回溯(最近一次调用最后一次):

文件setup.py,第24行,在?

import glob,os,re,sys

文件" /usr/lib64/python2.3/glob.py" ;,第4行,在?

import fnmatch

文件" /usr/lib64/python2.3/fnmatch.py​​" ;,第13行,在?

import re

文件/usr/lib64/python2.3/re.py" ;,第5行,在?

来自sre import *

文件" / usr / lib64 / python2.3 / sre.py",第97行,在?

import sre_compile

文件" /usr/lib64/python2.3/sre_compile.py" ;, line 17,in?

断言_sre.MAGIC == MAGIC,SRE模块不匹配

AssertionError:SRE模块不匹配


这对我来说基本上意味着Python2.4正在从/usr/lib/Python2.4的

/usr/lib64/Python2.3 insead中加载gloab.py(甚至认为我

想在/usr/lib64/Python2.4中安装相关文件。

有人可以帮忙!


恭敬地,

克里斯托弗·泰勒


Christopher Taylor schrieb:


这对我来说意味着Python2.4正在加载来自

/ usr / lib64 / Python2的gloab.py .3 /usr/lib/Python2.4的内容(甚至认为我想要在/usr/lib64/Python2.4中安装相关文件)


有人可以帮忙!



你能报告一下sys.path是什么吗?你有PYTHONPATH

设置,任何机会? Python通常不应该查看库中

完全不相关的安装。


问候,

Martin


Christopher Taylor schrieb:


这对我来说意味着Python2.4从

/usr/lib64/Python2.3 /usr/lib/Python2.4的内容(甚至认为我想要在/usr/lib64/Python2.4中安装相关文件) )


有人可以帮忙!



你能报告一下sys.path是什么吗?你有PYTHONPATH

设置,任何机会? Python通常不应该查看库中

完全不相关的安装。


问候,

Martin


RHEL comes with Python2.3 installed. A program I need to install
requires Python2.4

So I got Python2.4 from source and compiled it up. I configured it
with --prefix=/usr --exec-prefix=/usr and --enable-unicode=ucs4 . I
then make''d it and then make altinstall so that it didn''t overwrite
the /usr/bin/Python link to /usr/bin/Python2.3 .

Well, for some reason, the arch dependent files did NOT get placed
properly in /usr/lib64/Python2.4, they instead went to
/usr/lib/Python2.4.

Also, when I tried to load pysqlite:
$ Python2.4

>>from pysqlite2 import test

I get the following traceback:

Traceback (most recent call last):
File "setup.py", line 24, in ?
import glob, os, re, sys
File "/usr/lib64/python2.3/glob.py", line 4, in ?
import fnmatch
File "/usr/lib64/python2.3/fnmatch.py", line 13, in ?
import re
File "/usr/lib64/python2.3/re.py", line 5, in ?
from sre import *
File "/usr/lib64/python2.3/sre.py", line 97, in ?
import sre_compile
File "/usr/lib64/python2.3/sre_compile.py", line 17, in ?
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch

This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!

Respectfully,
Christopher Taylor

解决方案

Python2.4

>>from pysqlite2 import test

I get the following traceback:

Traceback (most recent call last):
File "setup.py", line 24, in ?
import glob, os, re, sys
File "/usr/lib64/python2.3/glob.py", line 4, in ?
import fnmatch
File "/usr/lib64/python2.3/fnmatch.py", line 13, in ?
import re
File "/usr/lib64/python2.3/re.py", line 5, in ?
from sre import *
File "/usr/lib64/python2.3/sre.py", line 97, in ?
import sre_compile
File "/usr/lib64/python2.3/sre_compile.py", line 17, in ?
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch

This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!

Respectfully,
Christopher Taylor


Christopher Taylor schrieb:

This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!

Can you please report what sys.path is? Do you have PYTHONPATH
set, by any chance? Python shouldn''t normally look into the library
of a totally unrelated installation.

Regards,
Martin


Christopher Taylor schrieb:

This basically means to me that Python2.4 is loading gloab.py from
/usr/lib64/Python2.3 insead of /usr/lib/Python2.4 (even thought I
wanted to install the related files in /usr/lib64/Python2.4)

Can someome please help!

Can you please report what sys.path is? Do you have PYTHONPATH
set, by any chance? Python shouldn''t normally look into the library
of a totally unrelated installation.

Regards,
Martin


这篇关于帮助:Python2.3& RHEL4 x86_64上的Python2.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆