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

Attempting to run the helloworld sample #240

Closed
clarkezone opened this issue Jun 13, 2020 · 19 comments · Fixed by #243 or #354
Closed

Attempting to run the helloworld sample #240

clarkezone opened this issue Jun 13, 2020 · 19 comments · Fixed by #243 or #354
Assignees
Labels
bug Something isn't working

Comments

@clarkezone
Copy link

Expected Behavior

Following through the tutorial here:
https://github.com/dapr/samples/tree/master/1.hello-world

Got as far as step 6.. everything worked up until that point. Now..

Actual Behavior

dapr run --app-id pythonapp python3 app.py
Starting Dapr with id pythonapp. HTTP Port: 62141. gRPC Port: 62142
exec: "python3": executable file not found in %!P(MISSING)ATH%!(NOVERB)

Steps to Reproduce the Problem

Try following the tutorial

@pruthvidhodda
Copy link
Contributor

Hey @clarkezone, may I know which version of python are you using?

@clarkezone
Copy link
Author

Python 3.8.3

@pruthvidhodda
Copy link
Contributor

pruthvidhodda commented Jun 15, 2020

Can you try using python instead of python3 like this: dapr run --app-id pythonapp python app.py

Edit: Can you confirm if you are using Windows?

@pruthvidhodda pruthvidhodda self-assigned this Jun 15, 2020
@clarkezone
Copy link
Author

I can do but what is the recommended way of installing a compatible version of Python?

@pruthvidhodda
Copy link
Contributor

If it's windows I would use the installer they provided: https://www.python.org/downloads/windows/

@MarcinKruszynski
Copy link

I have the same problem with Dapr, Python and Windows 10. I have tried:

  • Python 3.8 from Windows Store (only with python3 by default),
  • Python 3.8 full distribution for Windows (without python3)
  • Python 3.7 with Visual Studio 2019 (without python3)

I have tried also python command instead of python3 with dapr, but it doesn't work :(

I'm tired of figthing with Python with Dapr on Windows 10. Any simple way what to do to run this hello example with Dapr, Python 3.8 and Windows 10 x64?

P.S. I'm starting update my Windows 10 to version 2004. Maybe WSL2 would be better evironment for Python in the case?

@clarkezone
Copy link
Author

clarkezone commented Jun 16, 2020 via email

@pruthvidhodda pruthvidhodda added the bug Something isn't working label Jun 16, 2020
@pruthvidhodda
Copy link
Contributor

I am writing this as a small guide to do a clean install of python in windows 10 after which you should be able to run sample 1 smoothly.

  1. Download the Windows executable installer for Python 3.8.3 from the official python downloads page or just click this.
  2. Launch the downloaded installer and make sure you select the Add Python 3.8 to PATH checkbox as shown below:
    image
  3. Select the Install Now option to install Python 3.8
  4. Once the installation is done verify it by running the command which python in cmd. It should ideally point to your new installation which is c/Users/<username>/AppData/Local/Programs/Python/Python38/python
  5. If some other path is printed then go to the environment variables and remove/move down the path to other python installation.

Now you should be able to run sample 1 without any issues related to Python.

==================================================

I'm tired of figthing with Python with Dapr on Windows 10. Any simple way what to do to run this hello example with Dapr, Python 3.8 and Windows 10 x64?

Sorry about your experience @MarcinKruszynski , please try the above steps.

+1 to that. Wish there was a golang alternative in the helloworld example or at least make work with the most common way of getting python (eg windows store)

@clarkezone I was able to reproduce the issue while using Microsoft store to download Python - the go package used to find the python executable isn't able to identify it even when it's in the PATH. This needs a bit more study as to why it's happening. Fortunately there are other simple ways to get Python and I request you to please go through the steps I provided above.

@clarkezone
Copy link
Author

clarkezone commented Jun 18, 2020 via email

@pruthvidhodda
Copy link
Contributor

  1. If some other path is printed then go to the environment variables and remove/move down the path to other python installation.

Can you please verify if the python path added by installer is at the top in environment variables?

@kakridge
Copy link

Can you please verify if the python path added by installer is at the top in environment variables?

The installer attempted to add it, but it required admin privileges. I had to manually add it to my user env vars.

@pruthvidhodda
Copy link
Contributor

Did it work after that?

@kakridge
Copy link

Yes, it worked after that. I had to run "python" instead of "python3" also.

@pruthvidhodda
Copy link
Contributor

@clarkezone @MarcinKruszynski please see the discussion above and let me know if it's resolved.

@clarkezone
Copy link
Author

I will try installing the version here and manually adding path and ensure it’s above the store version which is uninstallable and let you know

@clarkezone
Copy link
Author

I concur, same here path was not added, it now works.

@pruthvidhodda
Copy link
Contributor

Good to know, I'll link this issue in sample 1 for future users.

@wcs1only
Copy link
Contributor

wcs1only commented Dec 22, 2020

Ultimate root cause of this is that golang can't handle windows AppStore App execution aliases. There is an upstream go issue for this:

golang/go#42919

No good fixes for dapr cli barring this issue gets fixed upstream, but I did find another workaround:

dapr run --app-id pythonapp cmd /c "python3 app.py"

This get dapr to invoke cmd which in turn can properly invoke the AppStore App execution alias. I think this is a slightly better workaround than installing another python package. I'll update the quickstart documentation with these details.

wcs1only added a commit to wcs1only/quickstarts that referenced this issue Dec 22, 2020
wcs1only added a commit to wcs1only/quickstarts that referenced this issue Dec 22, 2020
wcs1only added a commit to wcs1only/quickstarts that referenced this issue Dec 22, 2020
wcs1only added a commit to wcs1only/quickstarts that referenced this issue Dec 22, 2020
wcs1only added a commit that referenced this issue Dec 22, 2020
…workaround. (#354)

* Root cause found for #240. Updated hello-world README.md with better workaround

* Update README.md

Co-authored-by: Mark Fussell <mfussell@microsoft.com>
@AvtsVivek
Copy link

I installed ensuring that the installer adds to the path as shown here

And the dapr command should use python and not python3

dapr run --app-id pythonapp python app.py

Then it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants