Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Inline::Python for windows 10

by dbuckhal (Friar)
on Oct 16, 2018 at 03:16 UTC ( #1224089=note: print w/replies, xml ) Need Help??

in reply to Inline::Python for windows 10

If you are willing to use Cygwin on Windows 10, I was able to successfully install Inline::Python on Windows 10 using Cygwin(64bit):

  1. Install Cygwin.
  2. Using Cygwin Package Manager:
    1. Install perl-Inline.
    2. Install python and/or python3.
    3. Install python3-devel and/or python2-devel.
    4. Install libintl-devel (resolves a "mostly harmless" warning message...).
  3. From cpan (perl -MCPAN -e shell...)
    1. cpan1> get Inline::Python
    2. Go to the Inline::Python build directory (~/.cpan/build/Inline-Python-0.56-0).
    3. Execute the usual:
    4. NOTE: Defaults to "/usr/bin/python" You will need to enter "/usr/bin/python3", manually, if you prefer python3 (See "Use which?" under 'e', below).
      perl Makefile.PL make make test make install
    5. $ perl Makefile.PL Found these python executables on your PATH: 1. /usr/bin/python Use which? [1] /usr/bin/python3 Using /usr/bin/python3 Using These Settings: Extra Libs: -lintl -ldl Python Lib: -L/usr/lib/python3.6/config-3.6m-x86_64-cygwin -lpytho +n3.6m.dll Includes: -I/usr/include/python3.6m Extra Flags: none (perl Makefile.PL --help for details) Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Inline::Python Writing MYMETA.yml and MYMETA.json
    6. Test 35 will fail due to 'rss' not being available in Windows (See PORTING file under Proc::ProccessTable source).
      1. . . . t/31stringification.t ..... ok t/32boolean.t ............. ok t/33reinit.t .............. ok t/34env.t ................. ok t/35dictunicodememleak.t .. Can't access `rss' field in class Proc::Pr +ocessTable::Process at t/35dictunicodememleak.t line 28. # Looks like your test exited with 2 before it could output anything. t/35dictunicodememleak.t .. Dubious, test returned 2 (wstat 512, 0x200 +) Failed 2/2 subtests t/cmp.t ................... ok Test Summary Report ------------------- t/35dictunicodememleak.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 2 tests but ran 0. Files=37, Tests=838, 12 wallclock secs ( 0.12 usr 0.19 sys + 3.16 cu +sr 7.80 csys = 11.27 CPU) Result: FAIL Failed 1/37 test programs. 0/838 subtests failed. make: *** [Makefile:1061: test_dynamic] Error 255
    7. Rename "t/35dictunicodememleak.t"
    8. Tests pass:
. . . t/34env.t .............. ok t/cmp.t ................ ok All tests successful. Files=36, Tests=838, 12 wallclock secs ( 0.09 usr 0.22 sys + 2.94 cu +sr 7.37 csys = 10.62 CPU) Result: PASS


$ perl -e ' print "9 + 16 = ", add(9, 16), "\n"; print "9 - 16 = ", subtract(9, 16), "\n"; use Inline Python => <<"END_OF_PYTHON_CODE"; def add(x,y): return x + y def subtract(x,y): return x - y END_OF_PYTHON_CODE ' __output__ 9 + 16 = 25 9 - 16 = -7

Hope this helps, because this was a pain to type as appropriately formatted correctly as possible... Whew!

Aaaaand if you choose to say, "Screw Cygwin!", then that is OK, too. :)

Lastly, these steps worked for me, but YMMV...


Replies are listed 'Best First'.
Re^2: Inline::Python for windows 10
by tobbes (Acolyte) on Oct 17, 2018 at 11:26 UTC
    Unfortunately this is not an option, I did get it to install on linux subsystem as well without doing anything, but I am going to distribute the program I am creating to users and also need to convert it to .exe so cygwin or linux subsystem is not an option unfortunately. But rest assured, I sincearly appreciate the effort :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1224089]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2019-03-23 08:14 GMT
Find Nodes?
    Voting Booth?
    How do you Carpe diem?

    Results (114 votes). Check out past polls.