Python woes, works in CMD line, but not in PyCharm


So my first Python program, trying to get some data from a Siglent DMM

When I run CMD and Python, I can import a library called PyVisa, like this

import pyvisa

I can then connect and write to my instrument on USB

But, if I open PyCharm editor and write the same and execute, I get:

File "C:\Users\klaus\PycharmProjects\DCSweep2ndTry\", line 1, in <module>

import pyvisa ModuleNotFoundError: No module named 'pyvisa'

So tried to look for pyvisa, but have no idea where is has been installed (did a search of the HDD, to no evail)

Any hints how to proceed?

Delete all programs and start again? (pyvisa is probably installed in a non typical way, in the Python environment, and I have no idea how to find it)



Reply to
Klaus Vestergaard Kragelund
Loading thread data ...

lørdag den 11. september 2021 kl. 23.03.35 UTC+2 skrev Klaus Kragelund:

formatting link

Reply to
Lasse Langwadt Christensen

I did find this initially. And did find 4 files listed in "Python interpreter". But I cannot remove any of them

That worked:

You can do this by going into Pycharm->Preferences->Project Interpreter and click the "+" sign to look for PyVISA and have pip install it for you. You should be able to import it afterwards.

Lasse, you have saved my day. Spend 2 hours sofar trying to get it working. Thank you very much



Reply to
Klaus Vestergaard Kragelund

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.