Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PyVISA

Reply
Thread Tools

PyVISA

 
 
Manatee
Guest
Posts: n/a
 
      04-01-2011
I have unpacked the PyVISA files into the Python/lib/site-packages dir
and from the IDLE GUI I get and error

import visa

Traceback (most recent call last):
File "<pyshell#25>", line 1, in <module>
import visa
ImportError: No module named visa



There must be more to just putting the files in the correct directory.
Need help configuring PyVISA to work.
My ultimate goal is to control electronic instruments with Python
through visa.
 
Reply With Quote
 
 
 
 
Günther Dietrich
Guest
Posts: n/a
 
      04-01-2011
Manatee <(E-Mail Removed)> wrote:

>I have unpacked the PyVISA files into the Python/lib/site-packages dir
>and from the IDLE GUI I get and error
>
>import visa
>
>Traceback (most recent call last):
> File "<pyshell#25>", line 1, in <module>
> import visa
>ImportError: No module named visa
>
>
>
>There must be more to just putting the files in the correct directory.


Yes, there is more:

- DON'T unpack the files into any site-packages folder. If you already
have done it, remove them.
- Unpack the PyVISA archive to any other folder.
- On the command line, change into the PyVISA folder. There you should
find - among others - the two files setup.py and setup.cfg (at least
if you use PyVISA-1.3.tar.gz).
- Now, it depends on what variant of python you use and want to install
PyVISA for and on the configuration of your PYTHONPATH rsp. sys.path
and the folders they point to.
You can simply try: 'sudo python ./setup install'
If you are lucky, that's it. If not, you have to decide, where the
installation script has to put the files to. For example, for my
python 2.6, I chose
'/Library/Frameworks/Python.framework/Versions/2.6/'. In this path,
there is a folder 'lib/site-packages', which is pointed to by
sys.path, and where .pth files are evaluated.
- Edit the file setup.cfg. Near the end, in section '[install]', you will
find the line 'prefix=/usr'. Replace the '/usr' by your chosen path.
- Save the file and retry the install (see above).



Best regards,

Günther
 
Reply With Quote
 
 
 
 
Manatee
Guest
Posts: n/a
 
      04-01-2011
On Apr 1, 2:05*pm, "Gnther Dietrich" <(E-Mail Removed)> wrote:
> Manatee <(E-Mail Removed)> wrote:
> >I have unpacked the PyVISA files into the Python/lib/site-packages dir
> >and from the IDLE GUI I get and error

>
> >import visa

>
> >Traceback (most recent call last):
> > *File "<pyshell#25>", line 1, in <module>
> > * *import visa
> >ImportError: No module named visa

>
> >There must be more to just putting the files in the correct directory.

>
> Yes, there is more:
>
> - DON'T unpack the files into any site-packages folder. If you already
> * have done it, remove them.
> - Unpack the PyVISA archive to any other folder.
> - On the command line, change into the PyVISA folder. There you should
> * find - among others - the two files setup.py and setup.cfg (at least
> * if you use PyVISA-1.3.tar.gz).
> - Now, it depends on what variant of python you use and want to install
> * PyVISA for and on the configuration of your PYTHONPATH rsp. sys.path
> * and the folders they point to.
> * You can simply try: 'sudo python ./setup install'
> * If you are lucky, that's it. If not, you have to decide, where the
> * installation script has to put the files to. For example, for my
> * python 2.6, I chose
> * '/Library/Frameworks/Python.framework/Versions/2.6/'. In this path,
> * there is a folder 'lib/site-packages', which is pointed to by
> * sys.path, and where .pth files are evaluated.
> - Edit the file setup.cfg. Near the end, in section '[install]', you will
> * find the line 'prefix=/usr'. Replace the '/usr' by your chosen path..
> - Save the file and retry the install (see above).
>
> Best regards,
>
> * Gnther


Well, ok, I'll try some of that. But I am running window 7, not Linux.
The "sudo" command sounds like Linux.
 
Reply With Quote
 
P S
Guest
Posts: n/a
 
      04-23-2011
I did a little writeup for setting PyVISA up in Windows. It's not exactly polished, but it can get you through the difficult bits. If you need any additional help, leave comments/questions on my blog.

http://psonghi.wordpress.com/2011/03...up-in-windows/

> On Friday, April 01, 2011 11:29 AM Manatee wrote:


> I have unpacked the PyVISA files into the Python/lib/site-packages dir
> and from the IDLE GUI I get and error
>
> import visa
>
> Traceback (most recent call last):
> File "<pyshell#25>", line 1, in <module>
> import visa
> ImportError: No module named visa
>
>
>
> There must be more to just putting the files in the correct directory.
> Need help configuring PyVISA to work.
> My ultimate goal is to control electronic instruments with Python
> through visa.



>> On Friday, April 01, 2011 2:05 PM GntherDietrich wrote:


>> Yes, there is more:
>>
>> - DON'T unpack the files into any site-packages folder. If you already
>> have done it, remove them.
>> - Unpack the PyVISA archive to any other folder.
>> - On the command line, change into the PyVISA folder. There you should
>> find - among others - the two files setup.py and setup.cfg (at least
>> if you use PyVISA-1.3.tar.gz).
>> - Now, it depends on what variant of python you use and want to install
>> PyVISA for and on the configuration of your PYTHONPATH rsp. sys.path
>> and the folders they point to.
>> You can simply try: 'sudo python ./setup install'
>> If you are lucky, that is it. If not, you have to decide, where the
>> installation script has to put the files to. For example, for my
>> python 2.6, I chose
>> '/Library/Frameworks/Python.framework/Versions/2.6/'. In this path,
>> there is a folder 'lib/site-packages', which is pointed to by
>> sys.path, and where .pth files are evaluated.
>> - Edit the file setup.cfg. Near the end, in section '[install]', you will
>> find the line 'prefix=/usr'. Replace the '/usr' by your chosen path.
>> - Save the file and retry the install (see above).
>>
>>
>>
>> Best regards,
>>
>> G??nther



>>> On Friday, April 01, 2011 3:40 PM Manatee wrote:


>>> .
>>>
>>> Well, ok, I will try some of that. But I am running window 7, not Linux.
>>> The "sudo" command sounds like Linux.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[newbie] problem with module PyVisa Jean Dubois Python 5 11-20-2012 01:28 PM
Re: PyVISA eryksun () Python 2 04-02-2011 02:24 AM
ANN: PyVISA 1.1 -- GPIB, USB, RS232 instrument control Torsten Bronger Python 0 11-22-2006 06:45 AM
ANN: PyVISA 1.0 -- GPIB, USB, RS232 instrument control Torsten Bronger Python 0 01-24-2006 01:48 PM
ANN: PyVISA 0.9 (first public release) Torsten Bronger Python 0 06-30-2005 09:24 AM



Advertisments