Error Running test.py

177 views
Skip to first unread message

Guan Lao

unread,
Feb 16, 2024, 10:33:47 PM2/16/24
to OpenVSP
Hi All, 

I am new here and have been attempting to compile OpenVSP python API by following the build instructions for Windows on GitHub. I was able to finish all of the steps alright. I have also added this to the environment system variable path: C:\Users\Lemoning\Desktop\OpenVSP\build\vsp\src\python_api

However, when I run the BWB tutorial code from SUAVE, I get the error message: 
Reseting OpenVSP Model in Memory
VSP import failed
VSP import failed

I am suspecting that I did not add the openvsp api path correctly. If someone has done this before, could you please share what you did?

On the side note, I have also tried just downloading the zip file of OpenVSP and running this command in an anaconda environment python=3.9:
pip install -r requirements.txt

However, when I try running the test.py, I get this error:
 (myenv_py39) C:\Users\Lemoning\Downloads\OpenVSP-3.36.0-win64-Python3.9\OpenVSP-3.36.0-win64\python\openvsp\openvsp>cd tests

(myenv_py39) C:\Users\Lemoning\Downloads\OpenVSP-3.36.0-win64-Python3.9\OpenVSP-3.36.0-win64\python\openvsp\openvsp\tests>python test.py
Traceback (most recent call last):
  File "C:\Users\Lemoning\Downloads\OpenVSP-3.36.0-win64-Python3.9\OpenVSP-3.36.0-win64\python\openvsp\openvsp\tests\test.py", line 4, in <module>
    import openvsp as vsp
  File "C:\Users\Lemoning\anaconda3\envs\myenv_py39\lib\site-packages\openvsp\__init__.py", line 1, in <module>
    from .vsp import *
  File "C:\Users\Lemoning\anaconda3\envs\myenv_py39\lib\site-packages\openvsp\vsp.py", line 10, in <module>
    from . import _vsp
ImportError: cannot import name '_vsp' from partially initialized module 'openvsp' (most likely due to a circular import) (C:\Users\Lemoning\anaconda3\envs\myenv_py39\lib\site-packages\openvsp\__init__.py)

What is causing this?

I appreciate your help in advance!
Guan

karthi...@gmail.com

unread,
Feb 28, 2024, 6:29:27 PM2/28/24
to OpenVSP
I realize this might be a weird suggestion, but try a 3.11 environment and install. Reason I say this is in the switch from (3.6, 3.9) to (3.9, 3.11), some labeling issues may have arisen.
Reply all
Reply to author
Forward
0 new messages