get pivy for Python3 and Debian Buster

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
bernd
Posts: 8329
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

get pivy for Python3 and Debian Buster

Postby bernd » Sun Jan 06, 2019 6:49 pm

There seam to be two possibilities ATM on Debian Buster ...

get it from debian, create a debian package and install this package,

Code: Select all

rm -rf mypivy
mkdir mypivy
cd mypivy/
git clone https://salsa.debian.org/kkremitzki-guest/pivy
cd pivy
git archive remotes/origin/upstream | gzip > ../pivy_0.6.4.orig.tar.gz
dpkg-buildpackage -us -uc
cd $base_dir
sudo dpkg -i mypivy/python3-pivy_0.6.4-1_amd64.deb 
this takes loooong but works great here and it creates packages for python2 too, which may not needed



get it from FreeCAD and only build and install it (https://forum.freecadweb.org/viewtopic. ... 89#p270460)

Code: Select all

git clone https://github.com/FreeCAD/pivy
cd pivy
python3 setup.py build
sudo python3 setup.py install
or

Code: Select all

git clone https://github.com/FreeCAD/pivy
cd pivy
python3 setup_old.py build
sudo python3 setup_old.py install
non of the last one works for me ... I get either a

Code: Select all

Platform...linux
Python version...3.7.2
Checking for swig...
'/usr/bin/swig'
Checking for SWIG version...
3.0.12
calling: cmake 

checking for COIN via cmake

checking for SOQT via cmake

disable soqt, because cmake couldn't find it
Traceback (most recent call last):
  File "setup.py", line 671, in <module>
    platforms=['Any']
  File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 593, in run
    self.pivy_configure()
  File "setup.py", line 458, in pivy_configure
    self.check_with_cmake()
  File "setup.py", line 243, in check_with_cmake
    raise(RuntimeError('coin was not found, but you need coin to build pivy'))
RuntimeError: coin was not found, but you need coin to build pivy

or a

Code: Select all

Platform...linux
Python version...3.7.2
Checking for swig...
'/usr/bin/swig'
Checking for SWIG version...
3.0.12'
Warning: Pivy has only been tested with the following SWIG versions: 1.3.31 1.3.33 1.3.35 1.3.40.
Checking for coin-config...
not found.
but since creating the deb package works all needed packages to build pivy should be installed.
looo
Posts: 2818
Joined: Mon Nov 11, 2013 5:29 pm

Re: get pivy for Python3 and Debian Buster

Postby looo » Sun Jan 06, 2019 8:09 pm

Would be nice to know what the debian-script to make it work...

I guess you have a newer coin compiled with cmake, and for this version only the setup.py works. The setup_old.py is for coin compiled with autotools.
The pivy-setup runs a cmake script which runs find_package(Coin CONFIG REQUIRED). It's also possible to set the paths for coin or soqt manually. Similar to the way I am now doing here: https://github.com/conda-forge/pivy-fee ... soqt.patch

If anyone knows a better way to solve the pivy setup for coin configured with cmake please report them to the pivy-repo. Also if any patches are involved in building the newer pivy please report them.
User avatar
bernd
Posts: 8329
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: get pivy for Python3 and Debian Buster

Postby bernd » Sun Jan 06, 2019 8:45 pm

looo wrote:
Sun Jan 06, 2019 8:09 pm
Would be nice to know what the debian-script to make it work...
can I find this information somewhere in the pivy which I made the deb package with?


looo wrote:
Sun Jan 06, 2019 8:09 pm
I guess you have a newer coin compiled with cmake, and for this version only the setup.py works.
I use the package from Debian Buster.

Code: Select all

$ sudo dpkg -l | grep libcoin
ii  coinor-libcoinmp1v5:amd64                     1.8.3-2                               amd64        Simple C API for COIN-OR Solvers Clp and Cbc -- library
ii  coinor-libcoinutils3v5                        2.10.14+repack1-1                     amd64        Coin-or collection of utility classes (binaries and libraries)
ii  libcoin-dev                                   4.0.0~CMake~6f54f1602475+ds1-1        amd64        high-level 3D graphics devkit with Open Inventor and VRML97 support
ii  libcoin-runtime                               4.0.0~CMake~6f54f1602475+ds1-1        all          high-level 3D graphics kit - external data files
ii  libcoin80c                                    4.0.0~CMake~6f54f1602475+ds1-1        amd64        high-level 3D graphics kit implementing the Open Inventor API
ii  libcoin80v5                                   3.1.4~abc9f50+dfsg3-2                 amd64        high-level 3D graphics kit implementing the Open Inventor API
$ 
since I would like to use 4.0.0, this means I should use setup.py!

Which means I should give this a try ...
looo wrote:
Sun Jan 06, 2019 8:09 pm
It's also possible to set the paths for coin or soqt manually. Similar to the way I am now doing here: https://github.com/conda-forge/pivy-fee ... soqt.patch
I will report back ...
user1234
Posts: 181
Joined: Mon Jul 11, 2016 5:08 pm

Re: get pivy for Python3 and Debian Buster

Postby user1234 » Sun Jan 06, 2019 9:27 pm

Or you can download it on https://packages.debian.org/unstable/python3-pivy. But for me it does not work with FreeCAD. It do not recognize pivy. But i have not make a make clean so far. Could also be that the naming of the install files is not recognized from FreeCAD.

Greetings
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: get pivy for Python3 and Debian Buster

Postby NormandC » Sun Jan 06, 2019 10:48 pm

user1234 wrote:
Sun Jan 06, 2019 9:27 pm
But for me it does not work with FreeCAD.
That may be because this python-pivy package depends on the new libcoin80c package, and your FreeCAD is probably built with libcoin80v5 which is older. This is what's making the current freecad-stable PPA for Ubuntu 18.04/18.10 fail, python-pivy has been updated to the same version as in Debian unstable, but for a separate reason rebuilding the freecad package with libcoin80c is failing.

It works beautifully with the freecad-daily PPA, though.

Some further info: https://forum.freecadweb.org/viewtopic.php?f=4&t=33071
user1234
Posts: 181
Joined: Mon Jul 11, 2016 5:08 pm

Re: get pivy for Python3 and Debian Buster

Postby user1234 » Sun Jan 06, 2019 11:03 pm

Nope, all needed dependencies are installed. libcoin80c, libsoqt520, miscellaneous python3-pyside2 packages, shiboken2, ..... . If one package was missed, GDebi had not me installed pivy. But i do not need the draft workbench (for now).
Screenshot from 2019-01-06 23-56-51.png
Screenshot from 2019-01-06 23-56-51.png (56.01 KiB) Viewed 557 times
But thanks anyway.

Sorry for bad english
Greetings
user
User avatar
kkremitzki
Posts: 1708
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: get pivy for Python3 and Debian Buster

Postby kkremitzki » Mon Jan 07, 2019 12:20 am

Note that now you should be using https://salsa.debian.org/science-team/pivy instead of my repo.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
mlampert
Posts: 1304
Joined: Fri Sep 16, 2016 9:28 pm

Re: get pivy for Python3 and Debian Buster

Postby mlampert » Mon Jan 07, 2019 11:27 pm

kkremitzki wrote:
Mon Jan 07, 2019 12:20 am
Note that now you should be using https://salsa.debian.org/science-team/pivy instead of my repo.
Works like a charm, thanks for all this work, this is really awesome.

One question though, it seems pivy requires numpy - does that mean numpy is now a prerequisite for FC?
AKA, can one use numpy in a WB without introducing a new dependency?
User avatar
kkremitzki
Posts: 1708
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: get pivy for Python3 and Debian Buster

Postby kkremitzki » Mon Jan 07, 2019 11:31 pm

mlampert wrote:
Mon Jan 07, 2019 11:27 pm
kkremitzki wrote:
Mon Jan 07, 2019 12:20 am
Note that now you should be using https://salsa.debian.org/science-team/pivy instead of my repo.
Works like a charm, thanks for all this work, this is really awesome.

One question though, it seems pivy requires numpy - does that mean numpy is now a prerequisite for FC?
AKA, can one use numpy in a WB without introducing a new dependency?
I think so, since the FreeCAD package depends on matplotlib that introduces a transitive dependency on numpy.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
mlampert
Posts: 1304
Joined: Fri Sep 16, 2016 9:28 pm

Re: get pivy for Python3 and Debian Buster

Postby mlampert » Mon Jan 07, 2019 11:41 pm

I see, good to know - thanks for the background.