You are not logged in.
Friends,
After of install the Arch in my notebook (note: "/" and "/home" in separated partition) if I open a terminal/shell and try execute a python program/script in the /home partition I receive many erros and the program don't run:
[leandro@professionalit ~]$ alacarte
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/bin/alacarte", line 22, in <module>
from Alacarte.MainWindow import MainWindow
ImportError: No module named Alacarte.MainWindow
[leandro@professionalit ~]$
[leandro@professionalit ~]$ dropbox start
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/bin/dropbox", line 26, in <module>
import optparse
File "/usr/lib/python2.6/optparse.py", line 75, in <module>
import sys, os
File "os.py", line 2, in <module>
import socket
File "/usr/lib/python2.6/socket.py", line 92, in <module>
__all__.extend(os._get_exports_list(_socket))
AttributeError: 'module' object has no attribute '_get_exports_list'
But, if I go to another partition, for example, the folder opt in partition / (/opt) and try execute the program it run OK.
Any idea ?
Best regards,
Leandro.
Last edited by LeandroTiger (2010-05-21 23:02:29)
Offline
Friends,
Any idea ?
-- Leandro.
Offline
Try reinstalling gnome-menus package.
Offline
without success.
Offline
Try running the program like:
python /usr/bin/alacarte
Offline
[leandro@professionalit ~]$ cd ~
[leandro@professionalit ~]$ python /usr/bin/alacarte
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/bin/alacarte", line 22, in <module>
from Alacarte.MainWindow import MainWindow
ImportError: No module named Alacarte.MainWindow
[leandro@professionalit ~]$
[leandro@professionalit ~]$ cd /usr/
[leandro@professionalit usr]$ python /usr/bin/alacarte
[leandro@professionalit usr]$ python /usr/bin/alacarte &
[1] 5923
[leandro@professionalit usr]$
Last edited by LeandroTiger (2010-05-20 03:09:01)
Offline
Try reinstalling Python.
Offline
This is just intuiton I'm no programmer, but i think the traceback goes down to a python OS call for getting the exports lists, and that's enviroment variables, which could be the problem behind running it from different directories.
Maybe you've been messing around with those?
Cheers.
Last edited by Ekimino (2010-05-20 16:48:19)
Offline
Try reinstalling Python.
[leandro@professionalit opt]$ sudo pacman -S python
warning: python-2.6.5-3 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...
Targets (1): python-2.6.5-3
Total Download Size: 0.00 MB
Total Installed Size: 61.86 MB
Proceed with installation? [Y/n] y
checking package integrity...
(1/1) checking for file conflicts [#####################] 100%
(1/1) upgrading python [#####################] 100%
[leandro@professionalit ~]$ pwd
/home/leandro
[leandro@professionalit ~]$ alacarte
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/bin/alacarte", line 22, in <module>
from Alacarte.MainWindow import MainWindow
ImportError: No module named Alacarte.MainWindow
[leandro@professionalit ~]$ cd /opt/
[leandro@professionalit opt]$ alacarte &
[1] 4095
[leandro@professionalit opt]$
Last edited by LeandroTiger (2010-05-21 21:40:47)
Offline
Open a python interactive shell in your home dir, by just executing python without any arguments. Could you post the output of the following:
import sys
print sys.path
import site
import Alacarte
The first line imports the sys module, which contains much infomation about python. The second outputs the sys.path variable, which is a list of all the folders that python searches when importing a module. The third line imports the site module, which isn't used much, but when you executed alacarte, it failed to import this module, raising an error, which was hidden. You should be able to see the error in the interactive shell. The last line imports the Alacarte core module, and is just a test to see if any third party modules are working.
Consistency is not a virtue.
Offline
[leandro@professionalit ~]$ pwd
/home/leandro
[leandro@professionalit ~]$ python
'import site' failed; use -v for traceback
Python 2.6.5 (r265:79063, Apr 1 2010, 05:22:20)
[GCC 4.4.3 20100316 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '', '/usr/lib/openoffice/basis-link/program/', '/usr/lib/python26.zip', '/usr/lib/python2.6/', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload']
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/socket.py", line 79, in <module>
import os, sys, warnings
File "os.py", line 10, in <module>
from django.core.management import execute_manager
ImportError: No module named django.core.management
>>>
Last edited by LeandroTiger (2010-05-21 22:31:04)
Offline
[leandro@professionalit ~]$ pwd
/home/leandro
[leandro@professionalit ~]$ python
'import site' failed; use -v for traceback
Python 2.6.5 (r265:79063, Apr 1 2010, 05:22:20)
[GCC 4.4.3 20100316 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '', '/usr/lib/openoffice/basis-link/program/', '/usr/lib/python26.zip', '/usr/lib/python2.6/', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload']
>>> import site
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 62, in <module>
import os
File "os.py", line 2, in <module>
import socket
File "/usr/lib/python2.6/socket.py", line 92, in <module>
__all__.extend(os._get_exports_list(_socket))
AttributeError: 'module' object has no attribute '_get_exports_list'
>>> import Alacarte
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Alacarte
>>>
Offline
Friends,
That stupid I'm.
I had a os.py in my home folder and this was the root cause of the problem.
Thank you very much.
best regards,
Leandro.
Offline