Jump to content
Sign in to follow this  
lemon-p

Loading PythonInterfaceLin27.xpl causes X-Plane to quit

Recommended Posts

lemon-p    0
X-Plane 9 works fine on my fresh installation of Ubuntu 11.10. When I include Sandy's PythonInterfaceLin27.xpl in the /Resources/plugins directory, loading of X-Plane quits with :


Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 543, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 442, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 303, in _init_posix
makefile = _get_makefile_filename()
File "/usr/lib/python2.7/sysconfig.py", line 297, in _get_makefile_filename
return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'

Can anybody suggest what I can do to remedy or diagnose this problem?

$ python
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Thanks, Pete

Share this post


Link to post
Share on other sites
Sandy Barbour    203
No idea, never seen that error before.

Do you get any errors in the log.txt file in the X-Plane app folder?

You have the PythonScripts folder, yes?

I would recommend trying it with no scripts.
Then post the PythonInterfaceLog.txt file if it exists.

Share this post


Link to post
Share on other sites
lemon-p    0
log.txt ends with:

Loaded: /home/pete/X-Plane9/Resources/plugins/PluginAdmin/lin.xpl


PythonInterfaceLog.txt :

+++ LOGGING STARTED +++
PythonInterface 2.72.01 (SDK 2.00) - Sandy Barbour 2005
PythonInterface.ini file found
Before Py_Initialize()


That's all!

Share this post


Link to post
Share on other sites
Sandy Barbour    203
And you were not using a script?

Share this post


Link to post
Share on other sites
Sandy Barbour    203
Was this the version of python that came with Linux?
Or, did you update it?

Share this post


Link to post
Share on other sites
lemon-p    0
It's the Python that comes as part of the Ubuntu stock installation, no tinkering. Fresh install of Ubuntu from the daily build iso on Monday

Share this post


Link to post
Share on other sites
Sandy Barbour    203
The reason I asked was that a debian squeeze user had a problem with missing modules in the python .so.
This did not crash X-Plane, but it meant that some scripts would not run,
My plugin uses embedded python but it does depend on a python .so that has all modules in it.

I think you have a different problem.
Unfortunately, I don't think I am going to be able to help though.

Share this post


Link to post
Share on other sites
lemon-p    0
Well, here's a pretty pass. I installed python 2.7 from the Python repo. X-Plane & your plugin work perfectly now, it's just the rest of my desktop I've buggered up. Happy days!

Cheers, Pete

Share this post


Link to post
Share on other sites
Sandy Barbour    203
That is what I thought.
It looks like the python .so that was installed as part of the system does not have all the modules in it.
Installing the one from the python site will mean that the python .so will have all the modules.
It is strange that your desktop got messed up.
I am using ubuntu 9. something which had a very early version of python on it.
I have installed lots of later versions of python on that machine without any problems.
Thanks for trying this anyway, hope you get your desktop sorted. :)

Share this post


Link to post
Share on other sites
lemon-p    0
And finally ..... I could have flown to Rekjavik and back thrice in the time I've spent fannying about sorting this. Loads of nonsense with subprocess.Popen, PYTHONHOME, and all. Beer helped, and now everything is sweet.

Here are the stupid little scripts that got it all working, in case anybody's interested in future. I've no idea how or why they work, but they do: (/home/pete/Desktop/X-Plane9 = link to X-Plane-i686)

1.
#!/bin/sh

export PYTHONHOME=/home/python27/

exec "/home/python27/bin/python2.7" "/home/pete/Desktop/StartXPlane.py" "$@"
-------
2.
#!/home/python27/bin/python

import subprocess
from subprocess import Popen
command=('/home/pete/Desktop/X-Plane9')
subprocess.Popen(command)

Share this post


Link to post
Share on other sites
Pascal_LSGC    38
Hi !
I have the exact same problem here, Ubuntu 11.10 32bits X-plane10. X-plane is installed on an NTFS partition.
@ lemon-p: I'm trying to use your scripts. Something I don't understand: did you install Python 2.7 in your home folder ? If so, how did you do it ?

Thanks !

Pascal

Share this post


Link to post
Share on other sites
Vexor    59
Hi there!

Having the same issue on Ubuntu 11.10. After some discussion with my python-loving friends, we are gathering that the plugin is [color=#000000][font=Consolas,]mixing its own embedded python and the system python's stdlib, which is fragile at best. [/font][/color][color=#000000][font=Consolas,]it really should be bundling the stdlib, too, instead of relying on the system's.[/font][/color]

[color=#000000][font=Consolas,]Any fix?[/font][/color]

Share this post


Link to post
Share on other sites
Sandy Barbour    203
[quote name='Vexor' timestamp='1330869537' post='634850']
Hi there!

Having the same issue on Ubuntu 11.10. After some discussion with my python-loving friends, we are gathering that the plugin is [color=#000000][font=Consolas,]mixing its own embedded python and the system python's stdlib, which is fragile at best. [/font][/color][color=#000000][font=Consolas,]it really should be bundling the stdlib, too, instead of relying on the system's.[/font][/color]

[color=#000000][font=Consolas,]Any fix?[/font][/color]
[/quote]

No.

The heart of the problem is the way that python is now bundled with some distros.
The PythonInterface plugin has always relied on the python.so for its python support which in the past had full support.
With some newer distros the pyhon app does not rely on python.so, so python.so does not have the support that is required by my plugin.

Installing python from source fixes the problem, but if people don't want to do that then they can't use the PythonInterface plugin.
I don't intend to change the way I build my plugin, so we are at an empasse.

Share this post


Link to post
Share on other sites
Vexor    59
Fair enough, it needs to dynamically link to libpython2.7.so to stand a chance of working I guess..

Share this post


Link to post
Share on other sites
Sandy Barbour    203
[quote name='Vexor' timestamp='1330872726' post='634857']
Fair enough, it needs to dynamically link to libpython2.7.so to stand a chance of working I guess..
[/quote]

Which it does.
Ok, we will continue from email from this point. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×