× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks Kevin,

OK - having installed gcc and python3-devel via Open Source Package
Management ( I also upgrade Python from 3.6.6 to 3.6.8 ) I was successfully
able to install bpython.

bpython fired up ok and on first use appeared to be working - start typing
something like:

from sys import f

and it starts showing you the helpful code completion table

However when I started to type a loop:

for j in range(9):

as soon as I hit the colon it crashed out - presumably something to do with
setting up the auto indent.

here is an example of the error:

for j in range(9):

Traceback (most recent call last):

File "/home/RICHARC/pve1/venv/bin/bpython", line 11, in <module>

sys.exit(main())

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsies.py",
line 191, in main

exit_value = repl.mainloop(True, paste)

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsies.py",
line 126, in mainloop

self.process_event_and_paint(e)

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsies.py",
line 90, in process_event_and_paint

self.process_event(e)

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py",
line 603, in process_event

return self.process_key_event(e)

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py",
line 732, in process_key_event

self.on_enter()

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py",
line 817, in on_enter

self.push(self.current_line, insert_into_history=insert_into_history)

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py",
line 1087, in push

self.run_code_and_maybe_finish()

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py",
line 1090, in run_code_and_maybe_finish

r = self.coderunner.run_code(for_code=for_code)

File
"/home/RICHARC/pve1/venv/lib/python3.6/site-packages/bpython/curtsiesfrontend/coderunner.py",
line 138, in run_code

request = self.code_context.switch()

SystemError: <built-in method switch of greenlet.greenlet object at
0x700000000ad1768> returned NULL without setting an error

(venv) bash-4.4$

which at first glance looks very similar to the link Jesse provided.

regards,
Craig

On Tue, 2 Apr 2019 at 15:41, Kevin Adler <kadler@xxxxxxxxxx> wrote:

You need to install the python3-devel package in order to build Python
extensions written in C.


----- Original message -----
From: Craig Richards <craig@xxxxxxxxxxxxxxxx>
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxxxxxxxx>
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Cc:
Subject: Re: [IBMiOSS] bpython
Date: Tue, Apr 2, 2019 10:26 AM

Yeah I'm using SSH from a macbook and running bash 4.4 on the IBMi.

bpython is just a fancier interface to the python interpreter - it's
not
a
different python runtime..

I got a little further in the bpython install, having installed gcc
and
added it to my path in bash.
However my installation still fails, and given Jesse's comments it
seems
like there would be issues running it even if I could get through the
install.

For my own edification - I'm not sure if I've done something
incorrectly
-
my process was:

Go into my venv and activate it.
Pre-pend '/QOpenSys/pkgs/bin' to my PATH so that gcc could be found
Pip install bpython.

which resulted eventually in the following failure:

Installing collected packages: greenlet, bpython

Running setup.py install for greenlet ... error

Complete output from command /home/RICHARC/pve1/venv/bin/python3
-u
-c
"import setuptools,

tokenize;__file__='/tmp/pip-install-b4t8x_v2/greenlet/setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record
/tmp/pip-record-8e6jy0k0/install-record.txt
--single-version-externally-managed --compile --install-headers
/home/RICHARC/pve1/venv/include/site/python3.6/greenlet:

running install

running build

running build_ext

building 'greenlet' extension

creating build

creating build/temp.os400-powerpc64-3.6

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3
-Wall -O2 -g -maix64 -O2 -g -maix64 -I/home/RICHARC/pve1/venv/include
-I/QOpensys/pkgs/include/python3.6m -c greenlet.c -o
build/temp.os400-powerpc64-3.6/greenlet.o

In file included from greenlet.c:5:0:

greenlet.h:8:20: fatal error: Python.h: No such file or directory

#include <Python.h>

^

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------

regards,
Craig

On Tue, 2 Apr 2019 at 15:08, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

> On Tue, Apr 2, 2019 at 9:56 AM Craig Richards <
craig@xxxxxxxxxxxxxxxx>
> wrote:
> >
> > I'm not married to the idea of using bpython on the IBMi, I just
thought
> it
> > might be a bit nicer for the kind of ad-hoc stuff you sometimes
> investigate
> > using the REPL.
>
> While there have been great strides made in the Python-on-IBM-i
story,
> for general exploration *of Python itself* it's still best to use
> mainstream Python distributions on mainstream platforms. Learn
Python
> on a PC, Mac, or Linux box, and then take what you've learned and
> bring it to the i.
>
> That said, with modern tools, I find it is plenty easy enough to do
> "ad-hoc" stuff by creating proper Python scripts and modules in an
> editor and running them. If I have to define a function or write a
> loop, I'm already reaching for my editor.
>
> The first priority for interactive and ad-hoc exploration of the
PASE
> open source stuff is logging in via SSH and using bash. No green
> screen. You're using SSH, right?
>
> John Y.
> --
> This is the IBMi Open Source Roundtable (OpenSource) mailing list
> To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: [1]https://lists.midrange.com/mailman/listinfo/opensource
> or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at [2]https://archive.midrange.com/opensource.
>
> Help support midrange.com by shopping at amazon.com with our
affiliate
> link: [3]https://amazon.midrange.com
>
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [4]https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [5]https://archive.midrange.com/opensource.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: [6]https://amazon.midrange.com




References

Visible links
1. https://lists.midrange.com/mailman/listinfo/opensource
2. https://archive.midrange.com/opensource
3. https://amazon.midrange.com/
4. https://lists.midrange.com/mailman/listinfo/opensource
5. https://archive.midrange.com/opensource
6. https://amazon.midrange.com/
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.