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

Bug located in create virtual env create_venv_windows #350

Open
2 tasks done
kmahajan-cadfem opened this issue Sep 12, 2024 · 8 comments
Open
2 tasks done

Bug located in create virtual env create_venv_windows #350

kmahajan-cadfem opened this issue Sep 12, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@kmahajan-cadfem
Copy link
Collaborator

kmahajan-cadfem commented Sep 12, 2024

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 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

  • make sure you do not have global python installed on your machine
  • fire up Ansys Python Manager
  • select one of the ansys installation python
  • create venv
  • it says it sucessfully created but in reality the folder is empty

💻 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 kmahajan-cadfem added the bug Something isn't working label Sep 12, 2024
@kmahajan-cadfem
Copy link
Collaborator Author

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

@RobPasMue
Copy link
Member

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

@RobPasMue RobPasMue self-assigned this Sep 17, 2024
@RobPasMue
Copy link
Member

RobPasMue commented Sep 17, 2024

Steps to be followed:

  • Creating Windows 10 Hyper-V brand new VM
  • Installing Ansys 24R2 products in it
  • Making sure there is no global Python installation
  • Installing Ansys Python Manager version 0.3.8
  • Using Ansys Python (3.10) to create virtual environment
  • Verifying that the virtual environment exists and works fine

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

@RobPasMue
Copy link
Member

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
Copy link
Member

@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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

@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
Copy link
Member

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

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
Development

No branches or pull requests

2 participants