An import that fails only in the IDE

You need the pyvisa package to control a lab oscilloscope. In a terminal you run python -m pip install pyvisa, and it reports success. In the same terminal,


python -c "import sys; print(sys.executable)"


prints /usr/local/bin/python3. The IDE's status bar shows the selected interpreter as ~/lab/.venv/bin/python. You restart the IDE's console, but import pyvisa still raises ModuleNotFoundError: No module named 'pyvisa'.


What is the best next step?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Integrated Development Environment (IDE) Questions: