TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
GNU General Public License v3.0
571 stars 46 forks source link

Python Virtual Environments not Usable #691

Closed thomas-woehrle closed 3 weeks ago

thomas-woehrle commented 3 weeks ago

Describe the bug When one uses a python virtual environment to install the necessary dependencies, the schematic viewer does not work.

Code Creating pyenv virtualenv (assuming pyenv virtualenv plugin is installed):

pyenv virtualenv 3.x.x teroshdl
pyenv activate teroshdl
pip install vunit-hdl edalize yowasp-yosys cocotb

Then referencing the corresponding binary in the extension settings, fe: /Users/<username>/.pyenv/versions/3.12.7/envs/teroshdl/bin/python

Now, the dependency check goes through, but the schematic viewer throws this:

2024-11-01 17:41:01.885 [info] Executing: /bin/sh  /bin/sh -c  yowasp-yosys -p "read_verilog -sv "/<path>/add.v"; hierarchy -top add; proc; write_json .teroshdl_eOEbL; stat"
2024-11-01 17:41:01.987 [info] pyenv: yowasp-yosys: command not found

2024-11-01 17:41:02.065 [info] 
The `yowasp-yosys' command exists in these Python versions:

2024-11-01 17:41:02.066 [info]   3.12.7/envs/teroshdl
  teroshdl

2024-11-01 17:41:02.066 [info] 
Note: See 'pyenv help global' for tips on allowing both

2024-11-01 17:41:02.067 [info]       python2 and python3 to be found.

2024-11-01 17:41:02.067 [error] Yosys failed.

Please complete the following information:

Additional context I tried installing the dependencies in a global python binary and referencing that instead and it worked, so I assume that nothing else in my setup is broken.

qarlosalberto commented 3 weeks ago

In the schematic settings use the pre command option to activate your Python environment.

thomas-woehrle commented 3 weeks ago

Thank you @qarlosalberto that worked, however I had to do source ~/.zshrc && pyenv activate teroshdl &&, without the && at the end it didn't work, not sure if it is intended that the specified command is just inserted

thomas-woehrle commented 3 weeks ago

Also another question: Looking back my bug was not really a bug but a question and I have another question regarding syntax checking which is not a bug but just a question as well.

Is there a better place to ask these things?

qarlosalberto commented 3 weeks ago

You can open other issue.