Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Nidaqmx does not work in Python IDLE

Solved!
Go to solution

Hello!

 

I'm following the instruction on this page https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019Pf1SAE&l=pt-BR to read signals with a NI USB 4432.

 

I installed the NI DAQmx python API with

$ python -m pip install nidaqmx

If I try it again, it returns:Captura_powerShell.JPG

But if I try, on the Python IDLE SHELL, to import nidaqmx with

>>> import nidaqmx

I receive the this error message:


Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import nidaqmx
ModuleNotFoundError: No module named 'nidaqmx'

 

In Spyder, it works normally, but I need to use it with the Python IDLE.

My Python version is 3.9.2.

 

Could someone help me? What should I do to NI DAQmx works with Python IDLE?

 

Thank you!

0 Kudos
Message 1 of 5
(1,780 Views)
Solution
Accepted by topic author A.Melchiors

Looks like nidaqmx package was installed in your Anaconda environment and not in your IDLE environment.

 

Please change your PATH variable to point to the Python IDLE folder instead of anaconda.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 5
(1,767 Views)

"Looks like nidaqmx package was installed in your Anaconda environment and not in your IDLE environment."

 

"Please change your PATH variable to point to the Python IDLE folder instead of anaconda."

 

Can you tell me how to change the PATH variable as you suggested?

0 Kudos
Message 3 of 5
(754 Views)

@HarryKuang wrote:

"Looks like nidaqmx package was installed in your Anaconda environment and not in your IDLE environment."

 

"Please change your PATH variable to point to the Python IDLE folder instead of anaconda."

 

Can you tell me how to change the PATH variable as you suggested?


There are several ways to do that, here is a page that explains the common methods - https://datatofish.com/add-python-to-windows-path/

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 5
(736 Views)

Ok thanks. My Path is already pointing to the IDLE folder though:

 

For example Path=

C:\Users\harrykuang\AppData\Local\Programs\Python\Python312

 

My nidaqmx like you said is in:

C:\\ProgramData\\Miniconda3\\lib\\site-packages\\nidaqmx\\__init__.py

 

0 Kudos
Message 5 of 5
(728 Views)