الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

بخصوص تثبيت wxpython على توزيعة CentOS

بدأه Saleh Abbas في 27 يوليو 2011 · 16 رد · 968 مشاهدة · في لغة Python
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بعد التحية الكريمة لجميع الأعضاء الكرام، كنت قد قمت بتحميل الملف المصدرى لـ wxpython، وقد قمت بترجمته هكذا


./configure
make
make install

وقد تم التثبيت بنجاح، فأصبح بذلك عندى على النظام python 2.7 و أيضًا wxPython2.8.12.1

ولكن عند عمل import wx، لا يتعرف على المسار الخاص ببيئة البايثون، وذلك لأنى قمت بكتابة


>>> sys.path
['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']

وبالتالى لا يوجد به المسار الخاص بالـ wxpython

فكيف أضيفه إلى بيئة الـ python ؟

وشكرًا جزيلاً

تم تعديل هذه المشاركة بواسطة Saleh Abbas في 27 يوليو 2011 في 18:04

#2

اضف الي الباث بدالة append

جرب

sys.path.append(path to module)

تحياتي

other ESTJ thing

اقتباس
Help Me To Help You

0xBAD00DAD.png

#3

ولكن ما هو المسار بالتحديد الذى سوف أضيفه إلى المتغير path ، بمعنى أنى أصبح عندى مسار كبير بداخله مئآت المسارات

wxPython-src-2.8.12.1

فماذا أضيف بالتحديد ؟

#4

المسار الذي يحوي مجلد wx

other ESTJ thing

اقتباس
Help Me To Help You

0xBAD00DAD.png

#5

هذا المسار


/home/saleh/Packages/Python-2.7/wxPython-src-2.8.12.1/wxPython

يحتوى على


-rwxr-xr-x 1 saleh saleh 3652 Sep 7 2008 b
-rwxr-xr-x 1 saleh saleh 41 Jul 19 2007 b.bat
-rw-r--r-- 1 saleh saleh 230 Jul 16 06:16 build_options.py
-rw-r--r-- 1 saleh saleh 2366 Sep 7 2008 b.win32
-rw-r--r-- 1 saleh saleh 51147 Jul 14 05:48 config.py
drwxr-xr-x 9 saleh saleh 4096 Jul 16 06:16 contrib
drwxr-xr-x 8 saleh saleh 12288 Jul 16 06:16 demo
drwxr-xr-x 5 saleh saleh 4096 Jul 16 06:16 distrib
drwxr-xr-x 3 saleh saleh 4096 Jul 16 06:16 docs
drwxr-xr-x 3 saleh saleh 4096 Jul 16 06:16 include
drwxr-xr-x 2 saleh saleh 4096 Jul 16 06:16 licence
drwxr-xr-x 15 saleh saleh 4096 Jul 16 06:16 samples
drwxr-xr-x 2 saleh saleh 4096 Jul 16 06:16 scripts
-rwxr-xr-x 1 saleh saleh 38975 Jul 14 03:38 setup.py
drwxr-xr-x 5 saleh saleh 4096 Jul 16 06:16 src
drwxr-xr-x 2 saleh saleh 4096 Jul 16 06:16 SWIG
drwxr-xr-x 6 saleh saleh 4096 Jul 16 06:16 wx
drwxr-xr-x 4 saleh saleh 4096 Jul 16 06:16 wxPython
drwxr-xr-x 2 saleh saleh 4096 Jul 16 06:16 wxversion

فقمت بعمل

sys.path.append("/home/saleh/Packages/Python-2.7/wxPython-src-2.8.12.1/wxPython")

ولكن عندما أردت عمل import wx


ImportError: No module named wx

#6

بعيدا عن هذا الحل

في المجلد

/home/saleh/Packages/Python-2.7/wxPython-src-2.8.12.1/wxPython

اكتب

setup.py install

وجرب برنامجك

ان شاء الله تحل المشكلة

other ESTJ thing

اقتباس
Help Me To Help You

0xBAD00DAD.png

#7

عندما حاولت ترجمة عن طريق كتابة

python2.7 setup.py

كان هذا هو الخطأ


[root@localhost wxPython]# python2.7 setup.py
WARNING: WXWIN not set in environment. Assuming '..'
Found wx-config: /usr/local/bin/wx-config
Using flags: --toolkit=gtk2 --unicode=yes --version=2.8

Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --cxxflags
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.


Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --libs
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.


Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --basename
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.


Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --release
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.


Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --prefix
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.

Preparing CORE...
Preparing GLCANVAS...

Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --libs
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.


Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --libs gl
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.

Preparing STC...
Preparing GIZMOS...
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

أنا أعلم أنى قد أثقلت عليكم ولكن ما باليد حيله، واحترت أشد الحيره فى الحقيقة

#8

ولا يهمك حاولت المساعدة بما اعرفه عن بايثون وما اعرفه عن سنتوس فقط الاسم :/

اطلع على الروابط لربما تفيدك

وبالذات الاول

http://www.centos.org/modules/newbb/viewtopic.php?topic_id=32401&forum=14

http://rpm.pbone.net/index.php3/stat/4/idpl/9221217/dir/centos_5/com/wxPython-2.8.7.1-5.el5.kb.i386.rpm.html

تم تعديل هذه المشاركة بواسطة ihope في 27 يوليو 2011 في 22:45

other ESTJ thing

اقتباس
Help Me To Help You

0xBAD00DAD.png

#9

مازلت لا أستطيع حل المشكلة أخى، وأما بخصوص أول رابط فأنا العضو الذى وضع الإستفسار :) وبالفعل أشكرك على المساعده، وأتمنى أحد من الأخوه أن يساعدنا فى ذلك

#10

هل لديك مكتبة wxWidgets بالإضافة إلى ملفات التطوير؟ وكذلك آداة swig لكون الجسر في wxPython يستخدم swig

لماذا لاتستخدم مدير الحزم في العملية

(map share people)

فضلا لاتقم بمراسلتي من أجل أسئلة لها أقسامها في المنتدى حتى تعم الفائدة على الجميع وللحصول على إجابات أفضل من أعضاء أكثر خبرة.
Weblog
@bitbucket
@xmonader

#11

بالفعل أستاذى قد قمت بتثبيت مكتبة wxWidgets ، ولكن فى الحقيقهة احترت بسبب تلك المشكلة، فررت أن أعمل على الـ Windows Virtual Machine إلى حين حل تلك المشكلة،

وأشكركم على تعاونكم

#12

إزاي تغير نظام لخطأ في بناء مكتبة ؟؟

http://www.wxpython.org/builddoc.php

لم تجيبني هل متوفرة عندك في مدير الحزم أو لا ؟

(map share people)

فضلا لاتقم بمراسلتي من أجل أسئلة لها أقسامها في المنتدى حتى تعم الفائدة على الجميع وللحصول على إجابات أفضل من أعضاء أكثر خبرة.
Weblog
@bitbucket
@xmonader

#13

احترت أستاذى أشد الحيره، لذلك لجأت إلى ويندوز عندما أستعمل بايثون، ولينكس للباقى ^_^، نعم متوفره فى مدير الحزم وقد قمت بتثبيتها على أكمل وجه

#14

ياأخي مش فاهمك ... إذا متوفرة في مدير الحزم ليه مش بتستخدمه لعملية التنصيب ؟! وإذا قمت بتنصيبها على أكمل وجه فمالداعي لويندوز :S

(map share people)

فضلا لاتقم بمراسلتي من أجل أسئلة لها أقسامها في المنتدى حتى تعم الفائدة على الجميع وللحصول على إجابات أفضل من أعضاء أكثر خبرة.
Weblog
@bitbucket
@xmonader

#15

أستاذى الفاضل، كل شيئ قد تم تنصيبه بنجاح على CentOS ولكن المشكلة هي أن

sysy.path

عندما أستعرضه، لا أجده يحوى أى مسار على wxpython، بمعنى أنه موجود ولكن لا تعرف البايثون أين هو فعندما أقوم بكتابة


import wx

تكون النتيجة


ImportError: No module named wx

#16

شوف الصورة

292ns6t.png

وبعدها تستطيع إستدعاء wx بكل بساطة

اقتباس

[ahmed@localhost ~]$ python

Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)

[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import wx

>>>

أما للبناء من المصدر فمش سهل فإنت محتاج بالإضافة للكود المصدري ملفات التطوير الخاصة بمكتبة wxWidgets

http://www.wxwidgets.org/

(map share people)

فضلا لاتقم بمراسلتي من أجل أسئلة لها أقسامها في المنتدى حتى تعم الفائدة على الجميع وللحصول على إجابات أفضل من أعضاء أكثر خبرة.
Weblog
@bitbucket
@xmonader

#17

فعلاً أستاذى، أنا كنت متعود أن أبنى معظم البرامج من المصدر، وبالفعل هى عملية متعبه فى بعض الأحيان، فأشكرك جزيل الشكر على التعاون، وجعله الله فى ميزان حسناتكم

مواضيع مشابهة