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

emsdk activate latest --permanent does not add Python's executable to PATH #1315

Closed
vault-thirteen opened this issue Dec 5, 2023 · 5 comments

Comments

@vault-thirteen
Copy link

As stated in the title,
the emsdk activate latest --permanent command does not add Python's executable to the PATH environment variable.

@vault-thirteen
Copy link
Author

vault-thirteen commented Dec 5, 2023

If you need details, here are they.

After I used the above stated command, it added three (3) following records into my user-level PATH environment variable:

  • D:\Temp\1\emsdk
  • D:\Temp\1\emsdk\node\16.20.0_64bit\bin
  • D:\Temp\1\emsdk\upstream\emscripten

For some reason, the Python's folder which is D:\Temp\1\emsdk\python\3.9.2-nuget_64bit was not added by the tool.
I thought that the tool was very smart and saw that Python was already installed, but no.
My system did not have any stand-alone Python installation at that time.
So, this is a bug, 100%.

@sbc100
Copy link
Collaborator

sbc100 commented Dec 5, 2023

We deliberately don't add our internal version of python to the user's PATH, but instead set the EMSDK_PYTHON environment variable so that our launchers can use that to find our internal version of python.

The version of python we ship with emsdk is really designed as an implementation detail of emsdk and not designed to be used to other purposes. Is there some reason why you want/need it to be in your PATH?

@vault-thirteen
Copy link
Author

No, there is no special reason for that. I can use an external Python. I just thought that it should be in PATH since it was bundled.

@sbc100 sbc100 closed this as completed Dec 5, 2023
@vault-thirteen
Copy link
Author

vault-thirteen commented Dec 5, 2023

Controversy in environment variables.

There is a controversy.

In this issue 1315 (#1315) you say that python (EMSDK_PYTHON) is used only for internal purposes and thus it is not added to PATH variable.

But at the same time nodejs (EMSDK_NODE) is used for the same internal purposes but it is actually added to PATH variable.

EMSDK = D:/Temp/1/emsdk
EMSDK_NODE = D:\Temp\1\emsdk\node\16.20.0_64bit\bin\node.exe
EMSDK_PYTHON = D:\Temp\1\emsdk\python\3.9.2-nuget_64bit\python.exe
JAVA_HOME = D:\Temp\1\emsdk\java\8.152_64bit
Clearing existing environment variable: EMSDK_PY
Adding directories to PATH:
PATH += D:\Temp\1\emsdk
PATH += D:\Temp\1\emsdk\node\16.20.0_64bit\bin
PATH += D:\Temp\1\emsdk\upstream\emscripten

@sbc100
Copy link
Collaborator

sbc100 commented Dec 5, 2023

There is a controversy. In this issue you say that python is used only for internal purposes and thus it is not added to PATH variable. But nodejs is used for the same internal purposes but it is actually added to PATH variable.

EMSDK = D:/Temp/1/emsdk
EMSDK_NODE = D:\Temp\1\emsdk\node\16.20.0_64bit\bin\node.exe
EMSDK_PYTHON = D:\Temp\1\emsdk\python\3.9.2-nuget_64bit\python.exe
JAVA_HOME = D:\Temp\1\emsdk\java\8.152_64bit
Clearing existing environment variable: EMSDK_PY
Adding directories to PATH:
PATH += D:\Temp\1\emsdk
PATH += D:\Temp\1\emsdk\node\16.20.0_64bit\bin
PATH += D:\Temp\1\emsdk\upstream\emscripten

The situation with node is a little more completed. Historically we always added it to the PATH so that folk could run the output of emcc (e.g. for running test) so there is at least some need to node that is not internal. However a lot of foks were getting confused because we were clobber their existing version of node in their PATH.

As a compromise we settled on a solution where node is added, but only if it doesn't already exist in the users PATH: #1189. i.e. if you install your own version of node emsdk will stop adding node to your path.

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

2 participants