ansys / python-installer-qt-gui

Python QT app for installing Python
https://installer.docs.pyansys.com/
MIT License
29 stars 5 forks source link

Bug located in create virtual env `create_venv_windows` #350

Open kmahajan-cadfem opened 2 months ago

kmahajan-cadfem commented 2 months ago

πŸ” Before submitting the issue

🐞 Description of the bug

create virtual environment does not work on machine where there is no global python is installed, and even if it is installed most probably it wont work with the Ansys Python which is in the installation directory.

I have dug little bit into the code and seems like following command does not work

start /w /min cmd /K "set PATH=C:\Program Files\ANSYS Inc\v242\commonfiles\CPython\3_10\winx64\Release\python && python -m venv C:\Users\mkanchan\.ansys_python_venvs\test_venv && exit

this command when run in the console (cmd.exe), does not work and shows that python is not a command or executable

PS : the successful creation should check if the venv is actually created by checking the executables and activate files

PS2: in this template remove the I am using a Python virtual environment, this is not a standard for this repo

πŸ“ Steps to reproduce

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

242

🐍 Which Python version are you using?

3.10

πŸ“¦ Installed packages

-
kmahajan-cadfem commented 1 month ago

@anssakthi, @RobPasMue, is this reproducible for you as well or is there something wrong on our machines?

RobPasMue commented 1 month ago

I haven't been able to try it yet @kmahajan-cadfem - let me give it a go this morning.

RobPasMue commented 1 month ago

Steps to be followed:

Installation of Ansys 24R2 is taking quite a while - I'll keep you updated

RobPasMue commented 1 month ago

Replicated your case...

image

Whenever I click create, the process executes just fine. The virtual environment gets created. If I open a terminal afterwards with that venv and run the following...

image

The outputs are as expected. It seems @kmahajan-cadfem that this is specific to your environment.

RobPasMue commented 1 month ago

@kmahajan-cadfem - I'll leave it open a few more days in case you find something new but the current implementation works under the circumstances you posted so my feeling is that something else is interfering in your case... 😟

kmahajan-cadfem commented 1 month ago

Thanks for taking a look and I get it setting this up is a lot of work, on my system following itself is not working, hence I think this is something very weird but let me check few more systems on my end

set PATH=C:\Program Files\ANSYS Inc\v242\commonfiles\CPython\3_10\winx64\Release\python && python -m venv C:\Users\mkanchan\.ansys_python_venvs\test_venv 

Replicated your case...

image

Whenever I click create, the process executes just fine. The virtual environment gets created. If I open a terminal afterwards with that venv and run the following...

image

The outputs are as expected. It seems @kmahajan-cadfem that this is specific to your environment.

kmahajan-cadfem commented 1 month ago

@RobPasMue,

according to this line following command is used to create venv, I have tested it on 4 different machines

image

the error message for the create venv translates to

'python' is not recognized as an internal or external command,
operable program or batch file.

on the other hand setting a variable and piping with "&&" it to the next command did not work in any machines as well

image

seems like there is something basic that I am missing, could you point me to the correct direction

RobPasMue commented 1 month ago

Can't really tell at first sight... I'll have to debug more on my side. Sorry @kmahajan-cadfem