Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft updates to use py5 in first python path #118

Open
loiswells97 opened this issue Feb 2, 2023 · 3 comments
Open

Draft updates to use py5 in first python path #118

loiswells97 opened this issue Feb 2, 2023 · 3 comments

Comments

@loiswells97
Copy link
Contributor

Test the projects from the first python path in Thonny and make any updates required to get them working in the py5 syntax

@IzzySmillie IzzySmillie self-assigned this Feb 3, 2023
@create-issue-branch
Copy link
Contributor

@IzzySmillie
Copy link
Contributor

IzzySmillie commented Feb 3, 2023

  • Hello World
  • Target Practice

Error Steps

  • py5 install on Thonny is failing at line-profiler
  • line-profiler error: Failed to build line-profiler. ERROR: Could not build wheels for line-profiler, which is required to install pyproject.toml-based projects
  • Trying a pip install line-profiler also gets the same message. Thought it was worth a shot!
  • Also tried the --no-cache-dir flag
  • The error within line-profiler is line_profiler/_line_profiler.cpp:44:10: fatal error: 'Python.h' file not found

Thonny screenshots
Hello World project working:
Screenshot 2023-02-03 at 15 36 32

@IzzySmillie IzzySmillie removed their assignment Feb 3, 2023
@chrisruk chrisruk self-assigned this Feb 6, 2023
@chrisruk
Copy link
Contributor

chrisruk commented Feb 6, 2023

I was able to get thonny to work doing something like the following -

brew install [email protected]
brew install [email protected]
python3.9 -m pip install py5 
python3.9 -m pip install matplotlib # So that colour strings work in py5
python3.9 -m pip install thonny

python3.9 -m thonny

I think I had problems trying to get line-profiler to build/install with python 3.10

Although doing from py5 import * worked for generating graphics, as mentioned in their docs you can't use mouse variables such as doing print(mouse_x) would then fail. So you need to do print(py5.mouse_x)

To use 'imported mode' install the plugin 'thonny-py5mode', it will install a JDK. To use go to Tools > Options > General
and set 'environment variables' to something like -

JAVA_HOME=/Users/username/Library/Thonny/jdk-17/Home

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants