Python modülü yüklü değil veya yüklü?

0 Cevap php

Benim Python modülü başarıyla yüklü olup olmadığını nasıl kontrol edebilirim.

Yaptım:

python setup.py install

benim modül indirilen klasörü içinde.

Şimdi, ben bu yer içinde bir klasöre neden olduğunu görebilirsiniz:

/usr/lib/python2.4/site-packages (I can see my module folder is inside here)

Şimdi bu modülden bir komut dosyası çalıştırmak için PHP kullanıyorum:

exec("/usr/bin/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);

This runs the script.py file but does not load modules which this script requires. This script has code like this:

#! /usr/bin/env python 
import sys 
import os 
import getopt 
import re 
from myModule.ttLib import TTFont // this is line60 as I have removed comments

Ben bu hatayı alıyorum:

Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/MyModule/myModule/script.py", line 60, in ? from myModule.ttLib import TTFont ImportError: No module named myModule.ttLib

Does this mean there could be some problem with the way my module was installed. or How do I check if the module is installed correctly....

Ben de SSH terminali yapmak için çalıştı:

help('modules')

Bu modüllerin bir yük listede ama benim modül adı eksikti.

Herhangi bir yardım?

EDIT {Solved} ** Reinstalling the module solved it. Its funny that what I used online SSH tool provided by Mediatemple, it didnt install the module correctly. Later when I installed using Terminal from my Mac computer, everything worked.

Sadece ben benzer bir sorunla karşı karşıya olabilir kim diğeri için bu katacak düşündüm.

Teşekkürler

0 Cevap