Install problem: conflict between Python versions using Mandrake 9.1
Hello, I am in tp process making a transition from using Windows to using Linux, so I am quite inexperienced in the ways of Linux... I would like to install Spambayes, but I noticed that the requirements suggested Python 2.3 would be better thanPython 2.2. Since Mandrake 9.1 comes with Python 2.2.?, and I am a Python programmer, I thougth I would upgrade to Python 2.3. However, it seems that other software on mandrake requires 2.2 to be installed. So I downloaded built and installed Python 2.3.2. I wondered how the two versions would co-exist, and whether or not the Spambayes code would resolve the Python 2.3 interpreter and libraries, so I took a peak at the setup.py script, and the first line says: #!/usr/bin/env python It seems that neither the installed Mandrake, nor the new Python 2.3 installation configures a system-wide or user "PYTHON" variable, so I configured my .bash_profile with PYTHON=`which python2.3` export PYTHON The result is that in a bash shell PYTHON is defined: [parz@---- parz]$ env | grep PYTHON PYTHON=/usr/local/bin/python2.3 [parz@---- parz]$ So I ran setup.py as root, and I got the following failure: [root@---- spambayes-1.0a6]# ./setup.py install running install Traceback (most recent call last): File "./setup.py", line 97, in ? classifiers = [ File "/usr/lib/python2.2/distutils/core.py", line 138, in setup dist.run_commands() File "/usr/lib/python2.2/distutils/dist.py", line 893, in run_commands self.run_command(cmd) File "/usr/lib/python2.2/distutils/dist.py", line 912, in run_command cmd_obj.ensure_finalized() File "/usr/lib/python2.2/distutils/cmd.py", line 112, in ensure_finalized self.finalize_options() File "/usr/lib/python2.2/distutils/command/install.py", line 273, in finalize_options (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') File "/usr/lib/python2.2/distutils/sysconfig.py", line 427, in get_config_vars func() File "/usr/lib/python2.2/distutils/sysconfig.py", line 332, in _init_posix raise DistutilsPlatformError(my_msg) distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.2/config/Makefile (No such file or directory) So it seems that the distutils are retrieved from the Python 2.2 installation, not the Python 2.3 installation. So how do I get around this? Since I want to program using Python 2.3, and I can't apparently remove Python 2.2 without also removing other Mandrake 9.1 installed software, this problem affects me in a wider sense than just the ability to install and use Spambayes. Surely it must be a common situation faced by Python developers on Linux, with a straightforward solution.
The root problem is that Mandrake installs Python2.2 in "/usr/bin" and "/usr/lib" while the Python build installs it in "/usr/local/*" You can fix it in a number of ways. The simplest would be to change the PATH order in the shell you run spambayes. I changed the python in "/usr/bin" into a link to "/usr/local/bin". If you have trouble getting it to work with Python2.3 send me a private email and I'll try to help! Brendon. On Tuesday 28 October 2003 01:15 pm, Parzival Herzog wrote:
Hello,
I am in tp process making a transition from using Windows to using Linux, so I am quite inexperienced in the ways of Linux...
I would like to install Spambayes, but I noticed that the requirements suggested Python 2.3 would be better thanPython 2.2. Since Mandrake 9.1 comes with Python 2.2.?, and I am a Python programmer, I thougth I would upgrade to Python 2.3. However, it seems that other software on mandrake requires 2.2 to be installed. So I downloaded built and installed Python 2.3.2. I wondered how the two versions would co-exist, and whether or not the Spambayes code would resolve the Python 2.3 interpreter and libraries, so I took a peak at the setup.py script, and the first line says:
#!/usr/bin/env python
It seems that neither the installed Mandrake, nor the new Python 2.3 installation configures a system-wide or user "PYTHON" variable, so I configured my .bash_profile with
PYTHON=`which python2.3` export PYTHON
The result is that in a bash shell PYTHON is defined:
[parz@---- parz]$ env | grep PYTHON PYTHON=/usr/local/bin/python2.3 [parz@---- parz]$
So I ran setup.py as root, and I got the following failure:
[root@---- spambayes-1.0a6]# ./setup.py install running install Traceback (most recent call last): File "./setup.py", line 97, in ? classifiers = [ File "/usr/lib/python2.2/distutils/core.py", line 138, in setup dist.run_commands() File "/usr/lib/python2.2/distutils/dist.py", line 893, in run_commands self.run_command(cmd) File "/usr/lib/python2.2/distutils/dist.py", line 912, in run_command cmd_obj.ensure_finalized() File "/usr/lib/python2.2/distutils/cmd.py", line 112, in ensure_finalized self.finalize_options() File "/usr/lib/python2.2/distutils/command/install.py", line 273, in finalize_options (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') File "/usr/lib/python2.2/distutils/sysconfig.py", line 427, in get_config_vars func() File "/usr/lib/python2.2/distutils/sysconfig.py", line 332, in _init_posix raise DistutilsPlatformError(my_msg) distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.2/config/Makefile (No such file or directory)
So it seems that the distutils are retrieved from the Python 2.2 installation, not the Python 2.3 installation. So how do I get around this?
Since I want to program using Python 2.3, and I can't apparently remove Python 2.2 without also removing other Mandrake 9.1 installed software, this problem affects me in a wider sense than just the ability to install and use Spambayes. Surely it must be a common situation faced by Python developers on Linux, with a straightforward solution.
_______________________________________________ Spambayes@python.org http://mail.python.org/mailman/listinfo/spambayes Check the FAQ before asking: http://spambayes.sf.net/faq.html
Thank you Brendan, I found that my problem was my Windows prejudice (as I suspected) . The "PYTHON" variable should have been lower case, a distinction that does not matter in the Windows world, (and lower case environment variables are not the norm in the unix world either!). So, by fixing that I got the install to work, ran and configured the proxy server, and things appear to work as documented. I am now trying to set up the server to start automatically, and I again am confronting my (Windows conditioned) prejudices. I can't seem to be able to put a startup link in my .kde startup directory that will (a) establish the working directory (so that sb_server.py finds its .ini file), and (b) run in a terminal window that doesn't disappear when the program ends with a problem, so that I can read the python traceback or whatever is the failure symptom. The properties dialog for an application link has no help information, and so far neither the KDE docs, nor Google has provided any further useful info. I actually suspect that using the .kde startup method is not a good solution, as I would want the sb_server to run, regardless of the desktop environment selected.
If you have trouble getting it to work with Python2.3 send me a private email and I'll try to help!
configured my .bash_profile with
PYTHON=`which python2.3` export PYTHON
The result is that in a bash shell PYTHON is defined:
[parz@---- parz]$ env | grep PYTHON PYTHON=/usr/local/bin/python2.3
Hello, I'm running Mandrake 9.2 and am a new Linux user. I ran across this thread when I was researching a problem installing spambayes after I had setup Python 2.3.3. [root@linux spambayes-1.0a7]# python setup.py install running install error: invalid Python installation: unable to open /usr/lib/python2.3/config/Makefile (No such file or directory) Would you be able to help me resolve this issue? I have Spambayes running on Outlook in Windows, and am very impressed. I want to try to move most all of my desktop productivity stuff over to Linux though and want to make sure my favorite spam filter will work. Thanks, Brian Oppermann
Mandrake 9.2 may have a separate package for the Python interpreter and for the Python development environment. You need to install this package before building spambayes. For instance, on my RedHat 9 machine, /usr/bin/python comes from the package python-2.2.2-26, but /usr/lib/python2.2/config/Makefile comes from python-devel-2.2.2-26. I'm not familiar with Mandrake, but their documentation should guide you in installing a new package. The python-devel package should be on one of the installation CDs. Good luck! Jeff
participants (4)
-
Brendon -
Brian Oppermann -
Jeff Epler -
Parzival Herzog