[vtkusers] Errors in "vtkpython" interpretor (vtkpython 6.3.0.rc1 and pyQt5.2.1 )
Shawn Waldon
shawn.waldon at kitware.com
Tue Aug 11 11:01:04 EDT 2015
Hi Manjunath,
I think it may be easier to just get your system python to import vtk. The
paths in the vtkpython executable are compiled in and cannot be
overridden. I think you just need to add $vtk_install/lib and
$vtk_install/lib/python2.7/site-packages to your PYTHONPATH environment
variable to import vtk from the system's python.
HTH,
Shawn
On Tue, Aug 11, 2015 at 8:52 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Also, if you want to do a Debug build of VTK (and only in this case), you
> can install the python debug info:
>
> sudo apt-get install python-dbg
>
> On Tue, Aug 11, 2015 at 6:50 AM, David Gobbi <david.gobbi at gmail.com>
> wrote:
>
>> Hi Manjunath,
>>
>> Unfortunately, you cannot remove paths from vtkpython.
>>
>> You're facing a problem that happens to many users: you have multiple
>> copies of python on your computer, and the python you used to build VTK is
>> not the same as the python that you usually run from the command line.
>>
>> First, you should make sure that you have the python-dev package
>> installed:
>>
>> sudo apt-get install python-dev
>>
>> Then, in your VTK build, make sure that CMakeCache.txt points to the
>> system python:
>>
>> PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
>> PYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7
>> PYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so
>>
>> Then, when you build VTK, your "vtkpython" will use all of the same paths
>> as the system python.
>>
>> - David
>>
>>
>> On Tue, Aug 11, 2015 at 6:27 AM, Manjunath K E <ke.manjunath at gmail.com>
>> wrote:
>>
>>> Hi David Gobbi,,
>>>
>>> Thank you very much for the reply.
>>>
>>> The path obtained for *python* is
>>> ==================================
>>> /usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg
>>> /usr/lib/python2.7
>>> /usr/lib/python2.7/dist-packages
>>> /usr/local/lib/python2.7/site-packages
>>> /usr/lib/python2.7/lib-dynload
>>> /home/manju/manju/academics/iiitb/project/codes/qt
>>> /usr/lib/python2.7/plat-x86_64-linux-gnu
>>> /usr/lib/python2.7/lib-tk
>>> /usr/lib/python2.7/lib-old
>>> /usr/local/lib/python2.7/dist-packages
>>> /usr/local/lib/python2.7/dist-packages/Numeric
>>> /usr/lib/python2.7/dist-packages/PILcompat
>>> /usr/lib/python2.7/dist-packages/gtk-2.0
>>> /usr/lib/pymodules/python2.7
>>> /usr/lib/python2.7/dist-packages/ubuntu-sso-client
>>> /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
>>> =============================
>>> The path obtained for *vtkpython* is
>>> ==================================
>>> /usr/lib/python2.7
>>> /usr/lib/python2.7/dist-packages
>>> /usr/local/lib/python2.7/site-packages
>>> /usr/lib/python2.7/lib-dynload
>>> /home/manju/manju/academics/iiitb/project/codes/qt
>>> /home/kitware/Desktop/vtkbuild/build/install/lib/python27.zip
>>> /home/kitware/Desktop/vtkbuild/build/install/lib/python2.7
>>> /home/kitware/Desktop/vtkbuild/build/install/lib/python2.7/plat-linux2
>>> /home/kitware/Desktop/vtkbuild/build/install/lib/python2.7/lib-tk
>>> /home/kitware/Desktop/vtkbuild/build/install/lib/python2.7/lib-old
>>> /home/kitware/Desktop/vtkbuild/build/install/lib/lib-dynload
>>> ============================================
>>>
>>>
>>> How can, I make vtkpython to have same path as that of python.
>>> How can I remove the certain (kitware-related) paths from vtkpython.
>>>
>>> Thanks a lot.
>>>
>>> Thanks and Regards,
>>>
>>> Manjunath K E
>>> Help Ever Hurt Never
>>>
>>>
>>> On Tue, Aug 11, 2015 at 5:50 PM, David Gobbi <david.gobbi at gmail.com>
>>> wrote:
>>>
>>>> Hi Manjunath,
>>>>
>>>> Get a list of the paths within "python" and "vtkpython" to see what the
>>>> differences are:
>>>>
>>>> import sys
>>>> for p in sys.path: print p
>>>>
>>>> - David
>>>>
>>>> On Tue, Aug 11, 2015 at 5:40 AM, Manjunath K E <ke.manjunath at gmail.com>
>>>> wrote:
>>>>
>>>>> I have installed vtkpython 6.3.0.rc1 and pyQt5.2.1 manually.
>>>>>
>>>>> If I run a python script then it is working well without any error.
>>>>>
>>>>> But, if i run in "vtkpython" interpretor mode, i have following errors.
>>>>>
>>>>> I have set the *$PYTHONHOME *to contain *PyQt5 *but still problem
>>>>> exists.
>>>>>
>>>>>
>>>>> *export
>>>>> PYTHONPATH=/usr/lib/python2.7:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/:/usr/local/lib/python2.7/site-packages/usr/lib/python2.7/lib-dynload:$PYTHONPATH*
>>>>> manju at iiitb-gvcl-Z800:~/manju/qt$vtkpython
>>>>> vtk version 6.3.0
>>>>>
>>>>>
>>>>>
>>>>> *Could not find platform independent libraries <prefix>Could not find
>>>>> platform dependent libraries <exec_prefix>Consider setting $PYTHONHOME to
>>>>> <prefix>[:<exec_prefix>]*Python 2.7.2 (default, Feb 12 2015,
>>>>> 18:30:44)
>>>>> [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
>>>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> >>>
>>>>> *>>> from PyQt5.QtWidgets import **
>>>>> Traceback (most recent call last):
>>>>> File "<stdin>", line 1, in <module>
>>>>> ImportError: /usr/lib/python2.7/dist-packages/sip.so: undefined
>>>>> symbol: PyUnicodeUCS4_DecodeUTF8
>>>>> *>>> from PyQt5.QtWidgets import QApplication, QDialog*
>>>>> Traceback (most recent call last):
>>>>> File "<stdin>", line 1, in <module>
>>>>> ImportError: cannot import name QApplication
>>>>>
>>>>> *No error for below code*
>>>>> >>> from PyQt5 import *
>>>>> >>>
>>>>>
>>>>> Please help.
>>>>>
>>>>> Thanks and Regards,
>>>>> Manjunath K E
>>>>> Help Ever Hurt Never
>>>>>
>>>>>
>>>>
>>>
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150811/e126f1ce/attachment.html>
More information about the vtkusers
mailing list