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

Unable to open a PyMAPDL instance #2914

Closed
4 tasks done
clatapie opened this issue Mar 19, 2024 · 2 comments · Fixed by #2915
Closed
4 tasks done

Unable to open a PyMAPDL instance #2914

clatapie opened this issue Mar 19, 2024 · 2 comments · Fixed by #2915
Assignees

Comments

@clatapie
Copy link
Contributor

🤓 Before submitting the issue

🔍 Description of the bug

PyMAPDL is not launching on my laptop as shown bellow:

(.venv) PS D:\repos\pyansys\pymapdl_1> pymapdl start
There is an existing MAPDL instance at: 127.0.0.1:50052
Traceback (most recent call last):
  File "C:\Users\clatapie\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\clatapie\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\repos\pyansys\pymapdl_1\.venv\Scripts\pymapdl.exe\__main__.py", line 7, in <module>
  File "D:\repos\pyansys\pymapdl_1\.venv\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "D:\repos\pyansys\pymapdl_1\.venv\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "D:\repos\pyansys\pymapdl_1\.venv\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\repos\pyansys\pymapdl_1\.venv\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\repos\pyansys\pymapdl_1\.venv\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "D:\repos\pyansys\pymapdl_1\src\ansys\mapdl\core\cli.py", line 489, in start
    if len(out) == 3:
TypeError: object of type 'NoneType' has no len()
(.venv) PS D:\repos\pyansys\pymapdl_1> pymapdl stop
ERROR: No Ansys instances running on port 50052 have been found
(.venv) PS D:\repos\pyansys\pymapdl_1> pymapdl list
Name    Is Instance    Status    gRPC port    PID
------  -------------  --------  -----------  -----

Important note

MAPDL 2023 R2 is installed on my laptop and runs fine when opening it manually.

🕵️ Steps To Reproduce

The log will automatically be formatted as Python code! No need to type backticks.

pymapdl start

💻 Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.10

📝 PyMAPDL Report

Show the Report!

(.venv) PS D:\repos\pyansys\pymapdl_1> python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"
D:\repos\pyansys\pymapdl_1\.venv\lib\site-packages\pyvista\utilities\__init__.py:69: PyVistaDeprecationWarning: The `pyvista.utilities` module has been 
deprecated. `GPUInfo` is now imported as: `from pyvista.report import GPUInfo`.
  warnings.warn(
-------------------------------------------------------------------------------
PyAnsys Software and Environment Report
-------------------------------------------------------------------------------
  Date: Tue Mar 19 17:18:15 2024 Romance Standard Time

                               OS : Windows
                           CPU(s) : 24
                          Machine : AMD64
                     Architecture : 64bit
                              RAM : 63.7 GiB
                      Environment : Python
                       GPU Vendor : Intel
                     GPU Renderer : Intel(R) UHD Graphics 770
                      GPU Version : 4.5.0 - Build 31.0.101.4255

  Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64
  bit (AMD64)]

                 ansys.mapdl.core : 0.69.dev0
                            numpy : 1.25.2
                     platformdirs : 3.10.0
                            scipy : 1.12.0
                             grpc : 1.62.1
               ansys.api.mapdl.v0 : Version unknown
               ansys.mapdl.reader : 0.53.0
                  google.protobuf : 3.20.3
                       matplotlib : 3.8.3
                          pyvista : 0.43.4
                           pyiges : 0.3.1
                             tqdm : 4.66.1
               ansys_sphinx_theme : 0.14.1
                   ansys.dpf.core : 0.10.1
                   ansys.dpf.post : Module not found
                   ansys.dpf.gate : Version unknown
                ansys.fluent.core : Module not found
       ansys.fluent.visualization : Module not found
          ansys.fluent.parametric : Module not found
      ansys.grantami.bomanalytics : Module not found
             ansys.openapi.common : Module not found
ansys.platform.instancemanagement : 1.1.2
                   ansys.seascape : Module not found
               ansys.tools.report : 0.7.0
           ansys.tools.versioning : 0.4.0
                           pyaedt : Module not found
                          appdirs : 1.4.4
-------------------------------------------------------------------------------
Ansys Environment Report
-------------------------------------------------------------------------------


Ansys Installation
******************
No Ansys installations provided


Ansys Environment Variables
***************************
ANSYS221_DIR                   C:\Program Files\ANSYS Inc\v221\ANSYS
ANSYS222_DIR                   C:\Program Files\ANSYS Inc\v222\ANSYS
ANSYS231_DIR                   C:\Program Files\ANSYS Inc\v231\ANSYS
ANSYS232_DIR                   C:\Program Files\ANSYS Inc\v232\ANSYS
ANSYSEM_ROOT232                C:\Program Files\AnsysEM\v232\Win64
ANSYSLIC_DIR                   C:\Program Files\ANSYS Inc\Shared Files\Licensing
ANSYS_DPF_ACCEPT_LA            Y
ANSYS_LOCAL                    True
AWP_LOCALE222                  en-us
AWP_ROOT221                    C:\Program Files\ANSYS Inc\v221
AWP_ROOT222                    C:\Program Files\ANSYS Inc\v222
AWP_ROOT231                    C:\Program Files\ANSYS Inc\v231
AWP_ROOT232                    C:\Program Files\ANSYS Inc\v232
CADOE_LIBDIR221                C:\Program Files\ANSYS Inc\v221\CommonFiles\Language\en-us
CADOE_LIBDIR222                C:\Program Files\ANSYS Inc\v222\CommonFiles\Language\en-us
CADOE_LIBDIR231                C:\Program Files\ANSYS Inc\v231\CommonFiles\Language\en-us
CADOE_LIBDIR232                C:\Program Files\ANSYS Inc\v232\CommonFiles\Language\en-us
SIMPLORER_HOME                 C:\Program Files\AnsysEM\v232\Win64
SIWAVE_INSTALL_DIR             C:\Program Files\AnsysEM\v232\Win64

📝 Installed packages

Show the installed packages!

# PASTE HERE THE OUTPUT OF `python -m pip freeze` here

📝 Logger output file

Show the logger output file.

# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.

@germa89
Copy link
Collaborator

germa89 commented Mar 19, 2024

This due to a conflict between trying pymapdl start while having PYMAPDL_START_INSTANCE equal False.

(.venv) ubuntu@ip-10-231-106-87:~/pymapdl$ export PYMAPDL_START_INSTANCE=False
(.venv) ubuntu@ip-10-231-106-87:~/pymapdl$ pymapdl start
There is an existing MAPDL instance at: 127.0.0.1:50052
Traceback (most recent call last):
  File "/home/ubuntu/pymapdl/.venv/bin/pymapdl", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu/pymapdl/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/pymapdl/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/pymapdl/.venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/pymapdl/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/pymapdl/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/ubuntu/pymapdl/src/ansys/mapdl/core/cli.py", line 489, in start
    if len(out) == 3:
TypeError: object of type 'NoneType' has no len()

@clatapie
Copy link
Contributor Author

Thank you for your help @germa89, the error is solved!

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

Successfully merging a pull request may close this issue.

2 participants