Identify the Python version of VTK

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Identify the Python version of VTK

Ronald Römer
Hello.

How could I get the Python version VTK is wrapped to? I want to know
whether it is Python 2 or 3. Within CMake!


Best regards

Ronald

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Sebastien Jourdain via vtk-developers
The cmake variable VTK_PYTHON_VERSION has the requested version, and it's 2 by default. The user can make it more specific, like "3.6", for example.

-Aron

On Wed, Nov 28, 2018 at 9:43 AM Ronald Römer <[hidden email]> wrote:
Hello.

How could I get the Python version VTK is wrapped to? I want to know
whether it is Python 2 or 3. Within CMake!


Best regards

Ronald

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Ronald Römer
According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?


On 28.11.18 17:24, Aron Helser wrote:
The cmake variable VTK_PYTHON_VERSION has the requested version, and it's 2 by default. The user can make it more specific, like "3.6", for example.

-Aron

On Wed, Nov 28, 2018 at 9:43 AM Ronald Römer <[hidden email]> wrote:
Hello.

How could I get the Python version VTK is wrapped to? I want to know
whether it is Python 2 or 3. Within CMake!


Best regards

Ronald

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers


-- 
Viele Grüße
Ronald Römer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

David Gobbi
Hi Ronald,

The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.

  David


On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Ronald Römer
:(

On 28.11.18 19:18, David Gobbi wrote:
Hi Ronald,

The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.

  David


On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?


-- 
Viele Grüße
Ronald Römer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

David Gobbi
Would be a useful thing, though.  I'll see about submitting an MR.

On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
:(

On 28.11.18 19:18, David Gobbi wrote:
Hi Ronald,

The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.

  David


On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?


-- 
Viele Grüße
Ronald Römer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Ronald Römer

What else could I do to get the version?


On 28.11.18 19:32, David Gobbi wrote:
Would be a useful thing, though.  I'll see about submitting an MR.

On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
:(

On 28.11.18 19:18, David Gobbi wrote:
Hi Ronald,

The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.

  David


On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?


-- 
Viele Grüße
Ronald Römer
-- 
Viele Grüße
Ronald Römer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Sebastien Jourdain via vtk-developers
Can you run vtkpython and try something that only works in python 2
(or 3) and infer it...?
On Thu, Nov 29, 2018 at 4:06 AM Ronald Römer <[hidden email]> wrote:

>
> What else could I do to get the version?
>
>
> On 28.11.18 19:32, David Gobbi wrote:
>
> Would be a useful thing, though.  I'll see about submitting an MR.
>
> On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
>>
>> :(
>>
>> On 28.11.18 19:18, David Gobbi wrote:
>>
>> Hi Ronald,
>>
>> The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.
>>
>>   David
>>
>>
>> On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
>>>
>>> According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?
>>
>>
>> --
>> Viele Grüße
>> Ronald Römer
>
> --
> Viele Grüße
> Ronald Römer
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Sebastien Jourdain via vtk-developers
Hi Ronald,

Running the following with the help of execute_process should help answer your question:

./bin/vtkpython -c "import sys; print(sys.version_info[0:3])"

You could also call it three times in a row, to get major, minor and patch version.

./bin/vtkpython -c "import sys; print(sys.version_info[0])"
./bin/vtkpython -c "import sys; print(sys.version_info[1])"
./bin/vtkpython -c "import sys; print(sys.version_info[2])"

On Thu, Nov 29, 2018 at 9:28 AM David Cole via vtk-developers <[hidden email]> wrote:
Can you run vtkpython and try something that only works in python 2
(or 3) and infer it...?
On Thu, Nov 29, 2018 at 4:06 AM Ronald Römer <[hidden email]> wrote:
>
> What else could I do to get the version?
>
>
> On 28.11.18 19:32, David Gobbi wrote:
>
> Would be a useful thing, though.  I'll see about submitting an MR.
>
> On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
>>
>> :(
>>
>> On 28.11.18 19:18, David Gobbi wrote:
>>
>> Hi Ronald,
>>
>> The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.
>>
>>   David
>>
>>
>> On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
>>>
>>> According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?
>>
>>
>> --
>> Viele Grüße
>> Ronald Römer
>
> --
> Viele Grüße
> Ronald Römer
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Ronald Römer

Thanks.

On 29.11.18 16:00, Jean-Christophe Fillion-Robin wrote:
Hi Ronald,

Running the following with the help of execute_process should help answer your question:

./bin/vtkpython -c "import sys; print(sys.version_info[0:3])"

You could also call it three times in a row, to get major, minor and patch version.

./bin/vtkpython -c "import sys; print(sys.version_info[0])"
./bin/vtkpython -c "import sys; print(sys.version_info[1])"
./bin/vtkpython -c "import sys; print(sys.version_info[2])"

On Thu, Nov 29, 2018 at 9:28 AM David Cole via vtk-developers <[hidden email]> wrote:
Can you run vtkpython and try something that only works in python 2
(or 3) and infer it...?
On Thu, Nov 29, 2018 at 4:06 AM Ronald Römer <[hidden email]> wrote:
>
> What else could I do to get the version?
>
>
> On 28.11.18 19:32, David Gobbi wrote:
>
> Would be a useful thing, though.  I'll see about submitting an MR.
>
> On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
>>
>> :(
>>
>> On 28.11.18 19:18, David Gobbi wrote:
>>
>> Hi Ronald,
>>
>> The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.
>>
>>   David
>>
>>
>> On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
>>>
>>> According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?
>>
>>
>> --
>> Viele Grüße
>> Ronald Römer
>
> --
> Viele Grüße
> Ronald Römer
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

-- 
Viele Grüße
Ronald Römer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Sebastien Jourdain via vtk-developers

On Thu, Nov 29, 2018 at 10:02 AM Ronald Römer <[hidden email]> wrote:

Thanks.

On 29.11.18 16:00, Jean-Christophe Fillion-Robin wrote:
Hi Ronald,

Running the following with the help of execute_process should help answer your question:

./bin/vtkpython -c "import sys; print(sys.version_info[0:3])"

You could also call it three times in a row, to get major, minor and patch version.

./bin/vtkpython -c "import sys; print(sys.version_info[0])"
./bin/vtkpython -c "import sys; print(sys.version_info[1])"
./bin/vtkpython -c "import sys; print(sys.version_info[2])"

On Thu, Nov 29, 2018 at 9:28 AM David Cole via vtk-developers <[hidden email]> wrote:
Can you run vtkpython and try something that only works in python 2
(or 3) and infer it...?
On Thu, Nov 29, 2018 at 4:06 AM Ronald Römer <[hidden email]> wrote:
>
> What else could I do to get the version?
>
>
> On 28.11.18 19:32, David Gobbi wrote:
>
> Would be a useful thing, though.  I'll see about submitting an MR.
>
> On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
>>
>> :(
>>
>> On 28.11.18 19:18, David Gobbi wrote:
>>
>> Hi Ronald,
>>
>> The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.
>>
>>   David
>>
>>
>> On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
>>>
>>> According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?
>>
>>
>> --
>> Viele Grüße
>> Ronald Römer
>
> --
> Viele Grüße
> Ronald Römer
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

-- 
Viele Grüße
Ronald Römer
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Identify the Python version of VTK

Ronald Römer

What do you think about this wrapping https://gist.github.com/zippy84/ee6b4d04222ed62599f484cefdea2ecb ? It's a lot of code for such a simple thing, but it works. Feel free to change it.

On 29.11.18 16:05, Jean-Christophe Fillion-Robin wrote:

On Thu, Nov 29, 2018 at 10:02 AM Ronald Römer <[hidden email]> wrote:

Thanks.

On 29.11.18 16:00, Jean-Christophe Fillion-Robin wrote:
Hi Ronald,

Running the following with the help of execute_process should help answer your question:

./bin/vtkpython -c "import sys; print(sys.version_info[0:3])"

You could also call it three times in a row, to get major, minor and patch version.

./bin/vtkpython -c "import sys; print(sys.version_info[0])"
./bin/vtkpython -c "import sys; print(sys.version_info[1])"
./bin/vtkpython -c "import sys; print(sys.version_info[2])"

On Thu, Nov 29, 2018 at 9:28 AM David Cole via vtk-developers <[hidden email]> wrote:
Can you run vtkpython and try something that only works in python 2
(or 3) and infer it...?
On Thu, Nov 29, 2018 at 4:06 AM Ronald Römer <[hidden email]> wrote:
>
> What else could I do to get the version?
>
>
> On 28.11.18 19:32, David Gobbi wrote:
>
> Would be a useful thing, though.  I'll see about submitting an MR.
>
> On Wed, Nov 28, 2018 at 11:28 AM Ronald Römer <[hidden email]> wrote:
>>
>> :(
>>
>> On 28.11.18 19:18, David Gobbi wrote:
>>
>> Hi Ronald,
>>
>> The exported configuration options are in VTKConfig.cmake.  I searched this file, and the only Python-related setting was VTK_WRAP_PYTHON.  VTK doesn't export VTK_PYTHON_VERSION for use by other projects.
>>
>>   David
>>
>>
>> On Wed, Nov 28, 2018 at 10:55 AM Ronald Römer <[hidden email]> wrote:
>>>
>>> According to https://blog.kitware.com/vtk-7-0-0/ VTK_PYTHON_VERSION should be set. I installed VTK 8.1.2 with pacman on Arch Linux. These are the variables starting with VTK_: https://gist.github.com/zippy84/1d4560c721018ebd31ddc87fbfae8083 But where is VTK_PYTHON_VERSION? Do you have an idea?
>>
>>
>> --
>> Viele Grüße
>> Ronald Römer
>
> --
> Viele Grüße
> Ronald Römer
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

-- 
Viele Grüße
Ronald Römer
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers