First time here? Check out the FAQ!
1

Restarting Python Shell not working with pyenv

Hi,

I am trying to use pyenv with WingIDE Pro 7. I've used

import sys
print(sys.executable)

and get the python executable path as

/home/dtnlp/.pyenv/versions/vPy36/bin/python

Then, I open the Project Properties dialog window and chose [Command Line] to put the executable python path in it.

After resting the Python Shell tab from [Options], it still gives me this message:

Cannot execute: use Options -> restart Shell to launch shell [Needs restart for Python env]

I've repeated the steps many times, but still cannot get my Python Shell working under WingIDE.

Please kindly advise what I can do. Many many thanks in advance. :)

-- Peter. w

PeterWolf's avatar
26
PeterWolf
asked 2022-11-03 21:37:46 -0500
Wingware Support's avatar
4.1k
Wingware Support
updated 2022-11-04 07:56:11 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Could you please try setting the Debugger > Diagnostics > Python Shell Debug Log preference, restarting the Python Shell from its Options menu, and sending the log to support@wingware.com? Please don't set the Extremely Verbose option, though.

Wingware Support's avatar Wingware Support (2022-11-04 09:01:44 -0500) edit

I managed to replicate this here. Will add an answer...

Wingware Support's avatar Wingware Support (2022-11-04 10:55:47 -0500) edit

Also, the diagnostic log is not produced because the crash is early in Python's startup. So no need to try to obtain that.

Wingware Support's avatar Wingware Support (2022-11-04 11:04:22 -0500) edit
add a comment see more comments

2 Answers

0

It looks like Python 3.6.15 as installed by pyenv segfaults randomly. It also crashes on the command line for me if I try to create a virtualenv. I'm not sure of the reason for this, but I'd recommend just using a newer version of Python. I didn't run into any problems with Python 3.11.0.

My environment when testing this was: Ubuntu 22.04, pyenv 2.3.6 installed from https://pyenv.run, Wing 9.0.0.5.

Wingware Support's avatar
4.1k
Wingware Support
answered 2022-11-04 11:00:16 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

Hello, thanks for the test and reply.

I've managed to figured out a solution. I installed the Python 3.6.15, in my case, using clang:

$ sudo apt install clang -y
$ CC=clang pyenv install 3.6.15

Then everything works fine now.

We are planning to migrate to Python 3.9 or Python3.11 in 2023, and we are evaluating WingIDE 9. Meanwhile, there are dozens of website built under Python3.6.

PeterWolf's avatar
26
PeterWolf
answered 2022-11-05 05:46:31 -0500
edit flag offensive 0 remove flag delete link

Comments

Great, thanks for figuring this out and posting the solution!

Wingware Support's avatar Wingware Support (2022-11-05 10:08:17 -0500) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer