Giter Club home page Giter Club logo

Comments (13)

lurch avatar lurch commented on June 18, 2024 1

You do not need to edit the path if you launch the Pico project generator from outside the Pico developer prompts

But I guess if you do that, then the "Build after project created" option of pico-project-generator won't work?

from pico-setup-windows.

ullibak avatar ullibak commented on June 18, 2024 1

With the modifications in pico-env.cmd I can use the pico command prompt environment that contains all the paths etc. and have a "full" python at my disposal.
If I use an "ordinary" command prompt, the project generator does not even start. Error message is "Unable to find the 'arm-none-eabi-gcc' compiler....".
So the GUI-version of the project generator needs a "pico environment" and tkinter at the same time.

from pico-setup-windows.

ndabas avatar ndabas commented on June 18, 2024 1

Just out of curiosity, is there a reason we can't do that? https://docs.python.org/3/using/windows.html#installing-without-ui

Yes. One of the goals of this Windows installer is to have a stable distribution which will continue to work exactly as it does today. If we run the Python installer instead of bundling the embedded distribution, it will not actually install the version we want if the user already has a newer version installed, which can potentially break stability for us.

This is actually the approach that I had before it became the official installer. There is a configuration file - x64.json - which will build the installer that way. However that was always problematic because installing anything globally can break for many reasons.

from pico-setup-windows.

JamesH65 avatar JamesH65 commented on June 18, 2024 1

Okay there is a hack-free way to use the Pico project generator on Windows:

  1. Install the SDK with this installer.
  2. Install the full version of Python from https://www.python.org/downloads/windows/.
  3. Open a Pico - Developer Command Prompt window.
  4. cd to the location where you have downloaded/cloned pico-project-generator.
  5. Launch using py.exe instead of python.exe: py pico_project.py --gui -- this will use the latest installed version (the full version) instead of the embedded distribution with the SDK.

Thanks for figuring that out. I'll update the README with this information.

from pico-setup-windows.

lurch avatar lurch commented on June 18, 2024

According to https://github.com/raspberrypi/pico-setup-windows/blob/master/config/x64-standalone.json it installs python-3.9.13-embed-amd64.zip and https://docs.python.org/3/using/windows.html#windows-embeddable says "Tcl/tk (including all dependants, such as Idle), pip and the Python documentation are not included."

ping @ndabas (author of this repo) and @JamesH65 (author of pico-project-generator )

from pico-setup-windows.

ullibak avatar ullibak commented on June 18, 2024

Thanks for the clarification. So this is a feature not a bug :-).
For users of the python project generator GUI the simplest solution is most probably to (additionally) install a regular Python package and change the path to python.exe in "....\Pico SDK v1.5.0\pico-env.cmd". At least, this works fine for me.

from pico-setup-windows.

ndabas avatar ndabas commented on June 18, 2024

Yes, that's the thing -- we can only include the embedded distribution in our installer, which doesn't have support for Tcl/tk. The Python included with the SDK installer is sufficient only for the SDK build process, and isn't intended for general-purpose use beyond that.

The workaround, like you've figured out, is simply to install Python as usual. You do not need to edit the path if you launch the Pico project generator from outside the Pico developer prompts or VS Code.

from pico-setup-windows.

ndabas avatar ndabas commented on June 18, 2024

I guess the solution might be to create a Windows installer for pico-project-generator that fixes everything up properly and adds a shortcut to the Start menu to launch it. Modifying the path in a batch file, while a workaround for now, is not something that we should expect all users to do.

from pico-setup-windows.

JamesH65 avatar JamesH65 commented on June 18, 2024

Hmm, a bit of a PITA to fix I suspect. I'd hoped that the Project generator would be installed just by cloning the repo or copying the .py file, along with associated installs of Python/TkInter on all platforms. Just set the SDK path and it should all hang together. Sadly this appears not to be the case on Windows. You can set the compiler path on the command line with --cpath which might be an option, in combination with the SDK path. Or maybe a small install batch file for Windows although I am a bit out of touch with Windows stuff nowadays to know if that would be sufficient.

from pico-setup-windows.

ndabas avatar ndabas commented on June 18, 2024

The 'proper' way to do it would be to somehow get a Python distribution with Tcl/tk support in the SDK installer. We would either need to compile it ourselves in the build or use the hacky method of transplanting the needed files from the full installer into the embedded dist.

If we did it on the project generator side, the installer would install the full Python dist if needed, and a batch file to set up the paths correctly (or specify the compiler path on the command line) would be sufficient.

from pico-setup-windows.

lurch avatar lurch commented on June 18, 2024

The 'proper' way to do it would be to somehow get a Python distribution with Tcl/tk support in the SDK installer.

Just out of curiosity, is there a reason we can't do that? https://docs.python.org/3/using/windows.html#installing-without-ui

from pico-setup-windows.

ndabas avatar ndabas commented on June 18, 2024

Okay there is a hack-free way to use the Pico project generator on Windows:

  1. Install the SDK with this installer.
  2. Install the full version of Python from https://www.python.org/downloads/windows/.
  3. Open a Pico - Developer Command Prompt window.
  4. cd to the location where you have downloaded/cloned pico-project-generator.
  5. Launch using py.exe instead of python.exe: py pico_project.py --gui -- this will use the latest installed version (the full version) instead of the embedded distribution with the SDK.

from pico-setup-windows.

ullibak avatar ullibak commented on June 18, 2024

Tested in windows sandbox. Works fine. Thanks!
If you add a .cmd file (e.g. GenerateShortcut.cmd) to the project generator archive containing

echo cd %cd% > "%PICO_INSTALL_PATH%\generator.cmd"
echo py.exe pico_project.py --gui >> "%PICO_INSTALL_PATH%\generator.cmd"

the user can simply start a Pico Developer Comand Prompt, cd to the location of the project generator and run this cmd file once. From then on, it is sufficient to open the Developer Command Prompt and simply type "generator" to start the project generator.

from pico-setup-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.