Python 2.5与Fedora Core 6不兼容 - 再次打包问题 [英] Python 2.5 incompatible with Fedora Core 6 - packaging problems again

查看:55
本文介绍了Python 2.5与Fedora Core 6不兼容 - 再次打包问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Fedora Core 6的
a专用服务器上安装了Python及其支持包大约一天了。

这是标准的专用机架式服务器在一个托管的

设施中,通过Plesk控制面板进行控制,并在Fedora Core 6处于空状态时将
交给我。这是今天在colo中获得服务器的标准方式。


在这个完全干净的环境中引入Python是
$ b $很麻烦,它并没有真正起作用。


Fedora Core 6附带Python 2.4,这对某人来说似乎是一个很好的决定是的一部分。当然,Linux上的Python 2.5安装没有

标准RPM。根据Python开发人员的说法,包装是b b b b别人的问题。

因此有必要从源代码构建。并且python.org

FTP服务器已经关闭,所以即使将源代码放到远程的服务器上也很痛苦。所以我必须在另一台机器上下载

并用FTP将其下载。


尝试安装Python 2.5会产生至少以下问题:


Fedora Core 6附带GCC 4.1.1,但是使用Python 2.5的README文件

说:


GCC 4.1,

GCC 4.2:Python和GCC之间存在已知的不兼容性,

其中GCC 4.1及更高版本使用C的解释
与早期的GCC版本不同,其中C

规范具有未定义的行为(即整数算术

涉及-sys.maxint-1)。


因此,使用GCC 4.1 / 4.2编译Python并不是建议使用
。很可能这个问题将在未来的Python版本中得到解决

。作为一种解决方案,似乎在编译器选项中添加-fwrapv可以恢复早期的

GCC行为。


好吧,考虑到这一点,大概是./ configure。照顾好这个问题,

对吗?有人知道吗?


" make"在./ configure之后运行正常。


但是make install有些编译,有些东西是安装吗?可能

不应该这样做。其中一些编译失败,错误消息

喜欢

" /var/www/vhosts/sitetruth.com/private/downloads/python/Python-2.5/Modules /_curses_panel.c:271:

错误:PyCursesPanelObject没有名为pan的成员


但是安装脚本一味地插入,大概安装了一个破碎的
Python 2.5。显然Fedora Core 6并没有附带curses。预安装,

但Python安装程序假设它在那里。什么是不可原谅的是

只是在编译失败后才开始耕作,导致安装失败。


在建造之前可能需要安装一些东西Python,

但README文件对此保持沉默。


好​​的。向前倾斜,而不是真正需要诅咒库,

我们尝试安装MySQLdb。我们通过FTP得到它,

解压缩它,转到approprate目录,然后运行python setup.py。

这会失败,因为MySQL标题不是''安装:


" _mysql.c:35:23:错误:my_config.h:没有这样的文件或目录


OK ,看起来我们需要安装mysql-devel,所以我们这样做,

使用yum。这会强制更新OpenSSL,Kerberos和

" e2fsprogs-dev"。这意味着我们应该在某个时候重启。


但现在我们可以构建MySQLdb了。所以我们构建并安装它。


然后我们尝试导入MySQLdb。在Python 2.5中。我们得到这个:

I''ve been installing Python and its supporting packages on
a dedicated server with Fedora Core 6 for about a day now.
This is a standard dedicated rackmount server in a colocation
facility, controlled via Plesk control panel, and turned over
to me with Fedora Core 6 in an empty state. This is the
standard way you get a server in a colo today.

Bringing Python up in this completely clean environment is
a huge hassle, and it doesn''t really work.

Fedora Core 6 ships with Python 2.4, which appears to be a
good decision on someone''s part. Of course, there''s no
standard RPM for a Python 2.5 install on Linux. Packaging is
someone else''s problem, according to the Python developers.
So it''s necessary to build from source. And the "python.org"
FTP server is down, so even getting the source onto a remote
server is a pain. So I have to download it on another machine
and bring it over with FTP.

Trying to install Python 2.5 yields at least the following problems:

Fedora Core 6 comes with GCC 4.1.1, but the README file
with Python 2.5 says this:

GCC 4.1,
GCC 4.2: There is a known incompatibility between Python and GCC,
where GCC 4.1 and later uses an interpretation of C
different to earlier GCC releases in an area where the C
specification has undefined behaviour (namely, integer arithmetic
involving -sys.maxint-1).

As a consequence, compiling Python with GCC 4.1/4.2 is not
recommended. It is likely that this problem will be resolved
in future Python releases. As a work-around, it seems that
adding -fwrapv to the compiler options restores the earlier
GCC behaviour.

OK, given that, presumably "./configure" takes care of that problem,
right? Anybody know for sure?

"make" runs fine after "./configure".

But "make install" does some compiles, something "install" probably
shouldn''t be doing. Some of these compiles fail, with error messages
like
"/var/www/vhosts/sitetruth.com/private/downloads/python/Python-2.5/Modules/_curses_panel.c:271:
error: "PyCursesPanelObject" has no member named "pan"

But the install script plunges blindly on, presumably installing a broken
Python 2.5. Apparently Fedora Core 6 doesn''t come with "curses" preinstalled,
but the Python installer assumes it is there. What''s inexcusable is
just plowing on after failed compiles, resulting in a broken install.

It''s probably necessary to install something before building Python,
but the README file is silent on this.

OK. Plunging onward, and not really needing the "curses" library,
we try to install MySQLdb. We get that with FTP,
unpack it, go to the approprate directory, and run "python setup.py".
This fails because the MySQL headers aren''t installed:

"_mysql.c:35:23: error: my_config.h: No such file or directory"

OK, looks like we need to install "mysql-devel", so we do that,
using "yum". This forces an update of OpenSSL, Kerberos, and
"e2fsprogs-dev". Which means we should reboot at some point.

But now we can build MySQLdb. So we build and install it.

So then we try "import MySQLdb" in Python 2.5. And we get this:


/usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686。 egg / _mysql.py:3:UserWarning:模块_mysql已经从/usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/_mysql.pyc导入,但/var/www/vhosts/sitetruth.com/private/downloads/MySQLdb/MySQL-python-1.2.2正被添加到sys.path

import sys,pkg_resources,imp

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

文件"< stdin>",第1行,< module>

文件" MySQLdb / __ init __。py",第19行,在< module>

import _mysql

文件" build / bdist.linux-i686 / egg / _mysql.py" ,第7行,在< module>

文件" build / bdist.linux-i686 / egg / _mysql.py",第4行,在__bootstrap__

文件" ; /usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py",第800行,在resource_f中ilename

文件" /usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py" ;,第1228行,在get_resource_filename

文件" /usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py" ;,第1250行,在_extract_resource

文件" /usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py" ;,第880行,在get_cache_path中

文件" /usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py" ;,第846行,在extract_error中

pkg_resources.ExtractionError :无法将文件提取到egg缓存


尝试将文件提取到Python egg时发生以下错误

缓存:


[Errno 13]权限被拒绝:''/ var / www / vhosts / sitetruth.com/.python-eggs''


Python egg缓存目录目前设置为:


/ var / www / vhosts / sitetr uth.com/.python-eggs


也许您的帐户对此目录没有写入权限?您可以通过设置PYTHON_EGG_CACHE环境

变量来指向可访问的目录来更改缓存目录。
/usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/_mysql.pyc, but /var/www/vhosts/sitetruth.com/private/downloads/MySQLdb/MySQL-python-1.2.2 is being added to sys.path
import sys, pkg_resources, imp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MySQLdb/__init__.py", line 19, in <module>
import _mysql
File "build/bdist.linux-i686/egg/_mysql.py", line 7, in <module>
File "build/bdist.linux-i686/egg/_mysql.py", line 4, in __bootstrap__
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py", line 800, in resource_filename
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py", line 1228, in get_resource_filename
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py", line 1250, in _extract_resource
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py", line 880, in get_cache_path
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg/pkg_resources.py", line 846, in extraction_error
pkg_resources.ExtractionError: Can''t extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: ''/var/www/vhosts/sitetruth.com/.python-eggs''

The Python egg cache directory is currently set to:

/var/www/vhosts/sitetruth.com/.python-eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.



那么发生了什么?我们在假设Python

和Plesk控制面板之间遇到了冲突。 Plesk不允许用户在他们自己的主目录中创建文件

。此安装程序假定它可以。哎呀。

(Plesk设置了一个非常锁定的环境,这对

a web服务器来说是一件好事。)


因此,成为超级用户,我们创建.python-eggs并更改其所有权。

现在我们可以将MySQLdb导入Python。


现在它变成了我们在/ usr / bin中有Python 2.4,在/ usr / local / bin中有Python 2.5

脚本正在调用错误版本的Python。脚本必须更改



最后,MySQLdb正确地连接到MySQL。但是,SSL模块

似乎被打破了。明天我会处理这个问题,并尝试安装

M2Crypto,这总是一项艰巨的工作。


这种无稽之谈就是为什么托管公司不要我不想支持Python。

Perl和PHP可能很愚蠢,但它们只是起作用。 Java背后有一家公司。

Python还没准备好。这十年过得很尴尬。


如果Python人群想要市场份额,关注度和职业道路,那么这需要修复。

John Nagle

So what''s going on? We''ve run into a conflict between an assumption of Python
and of the Plesk control panel. Plesk doesn''t let the user create files
in their own home directory. This installer assumes it can. Oops.
(Plesk sets up a very locked down environment, which is a good thing on
a web server.)

So, becoming the super-user, we create .python-eggs and change its ownership.
Now we can import MySQLdb into Python.

Now it turns out that we have Python 2.4 in /usr/bin, and Python 2.5
in /usr/local/bin. That''s where the installer put it. So the CGI
scripts are invoking the wrong version of Python. The scripts had to
be changed.

At last, MySQLdb is connecting to MySQL properly. However, the SSL module
seems to be broken. Tomorrow I''ll deal with that, and try to get
M2Crypto installed, always a tough job.

This kind of nonsense is why hosting companies don''t want to support Python.
Perl and PHP may be dumb, but they just work. Java has a company behind it.
Python just isn''t ready. Which is embarassing, ten years on.

If the Python crowd wants market share, attention, and a career path,
this has to be fixed.

John Nagle

推荐答案

[snip]
[snip]

那么发生了什么?我们在假设Python

和Plesk控制面板之间遇到了冲突。 Plesk不允许用户在他们自己的主目录中创建文件

。此安装程序假定它可以。糟糕。

(Plesk设置了一个非常锁定的环境,这对于

a web服务器来说是一件好事。)
So what''s going on? We''ve run into a conflict between an assumption of Python
and of the Plesk control panel. Plesk doesn''t let the user create files
in their own home directory. This installer assumes it can. Oops.
(Plesk sets up a very locked down environment, which is a good thing on
a web server.)



安装程序使用你给它的选项,或者它们缺席时的默认值。

The "installer" used the options you gave it, or its defaults in their absence.


现在我们发现我们在/ usr / bin和Python 2.5中都有Python 2.4 / usr / local / bin中的
。这就是安装人员所说的。所以CGI

脚本正在调用错误版本的Python。脚本必须改变

Now it turns out that we have Python 2.4 in /usr/bin, and Python 2.5
in /usr/local/bin. That''s where the installer put it. So the CGI
scripts are invoking the wrong version of Python. The scripts had to
be changed.



您可以使用./ configure --prefix = / usr / local

You could have fixed this with "./configure --prefix=/usr/local"

$ b修复此问题$ b这种无稽之谈是托管公司不想支持Python的原因。
Perl和PHP可能很愚蠢,但它们只是起作用。 Java背后有一家公司。

Python还没准备好。十年来,这是令人尴尬的。
This kind of nonsense is why hosting companies don''t want to support Python.
Perl and PHP may be dumb, but they just work. Java has a company behind it.
Python just isn''t ready. Which is embarassing, ten years on.



让我们看看...


您正试图在不使用包的情况下安装包<你系统提供的
管理工具,你没有读过文件

(或至少所有这些),你表现出对

免费/开源软件空间的不同职责

(开发与包装)......毕竟,那么你来这里

抱怨?


看,我相信很多人都会很乐意帮助你,但你的

帖子会发出嘶嘶声和对抗的声音。我确定你有一个令人沮丧的经历,但请不要责怪蟒蛇。或者

python开发者,因为这个责任会被放错地方。

Let''s see...

You''re trying to install a package without using the package
management tools provided by your system, you haven''t read the docs
(or at least all of them), you show a general lack of understanding of
the different responsibilities in the free/open source software space
(development vs. packaging)... and after all that, then you come here
and complain?

Look, I''m sure lots of folks here would be glad to help you, but your
post comes across as whiny and confrontational. I''m sure you''ve had a
frustrating experience, but please, don''t blame "python" or "the
python developers", because that blame would be misplaced.


http:/ /www.serpentine.com/blog/2006/...fedora-core-6/


" Troy Melhase" < tr ********** @ gmail.comwrites:
"Troy Melhase" <tr**********@gmail.comwrites:

你试图在不使用软件包的情况下安装软件包

管理工具由您的系统提供,您还没有阅读文档

(或至少所有这些),您表现出对
$的普遍缺乏了解b $ b免费/开源软件空间的不同职责

(开发与包装)......然后你来到这里

并投诉?
You''re trying to install a package without using the package
management tools provided by your system, you haven''t read the docs
(or at least all of them), you show a general lack of understanding of
the different responsibilities in the free/open source software space
(development vs. packaging)... and after all that, then you come here
and complain?



只是为了甩掉火上浇油:有一些发行版附带Python

2.5打包和工作。 ;-)

Just to throw more on the fire: there are distributions that come with Python
2.5 packaged and working. ;-)


看,我相信很多人会很乐意帮助你,但是你的

帖子会遇到如同发牢骚和对抗。我确定你有一个令人沮丧的经历,但请不要责怪蟒蛇。或者

python开发者,因为这个责任会被放错地方。
Look, I''m sure lots of folks here would be glad to help you, but your
post comes across as whiny and confrontational. I''m sure you''ve had a
frustrating experience, but please, don''t blame "python" or "the
python developers", because that blame would be misplaced.



无论如何,如果在错误发生之后安装完成,那么一些开发人员应该看看它。

-

Jorge Godoy< jg **** @ gmail.com>

Anyway, if following the install after an error is true then some developer
should take a look at it.
--
Jorge Godoy <jg****@gmail.com>


这篇关于Python 2.5与Fedora Core 6不兼容 - 再次打包问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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