colinoflynn/pico-python

ImportError: No module named 'picoscope'

Closed this issue · 15 comments

Hi, I have followed the install instructions for picoscope using pip install picoscope. This seems to have been successful:

Successfully built numpy
Installing collected packages: numpy, picoscope
Successfully installed numpy-1.15.2 picoscope-0.7.5

However, when I run the ps2000 demo I receive an error:

File "/home/pi/projects/PicoPY_Example.py", line 20, in <module>
    from picoscope import ps2000
ImportError: No module named 'picoscope'

Can anyone please shed some light?

Thanks

Antony

p.s. I am running debian on raspberry pi 3 B

  1. Does the picoscope have drivers for ARM? You'll need them eventually.
  2. Can you try to import numpy?
  3. Can you show us the install commands?

Please see Markdown formatting to ensure we can easily read your post.

thanks alot for the fast response...

pi@raspberrypi:~ $ pip install picoscope
Collecting picoscope
Collecting numpy (from picoscope)
  Using cached https://files.pythonhosted.org/packages/45/ba/2a781ebbb0cd7962cc1d12a6b65bd4eff57ffda449fdbbae4726dc05fbc3/numpy-1.15.2.zip
Building wheels for collected packages: numpy
  Running setup.py bdist_wheel for numpy ... done
  Stored in directory: /home/pi/.cache/pip/wheels/3a/4d/27/ceb4416e50c3522656d512ef7736c69778241337afdc6506f0
Successfully built numpy
Installing collected packages: numpy, picoscope
Successfully installed numpy-1.15.2 picoscope-0.7.5

Ok thanks I mean, you still haven't showed us your original post. I modified them according to Markdown syntax.
Please see markdown formatting, it is really difficult to read your post
image

You answered Q3, can you answer Q1-2 as well?

Apologies. I will try to in future. Basically, I have downloaded the full file structure. Yet, when runnung the ps2000.py module, I get this error:

File "/home/pi/projects/PicoPY_Example.py", line 20, in <module>
from picoscope import ps2000
ImportError: No module named 'picoscope'

Can you tell me if I'm missing any steps here?

I'm certain I am not missing any drivers as I have previously connected to the device running the sample C examples provided by Picotech. It would just be a lot simpler for me to run Python and forget about producing the neccessary wrappers. I'm definately a newb, so would like to make this as simple as poss.

I get it, it has just been a while since I've been on the Picotech website. How are you executing your python program? Can you show me that command? Github is down so it is hard to see your messages in real time.

can you try running

python -c 'import picoscope'
  1. I'm afraid I dont know if the device itself has drivers for ARM. I am using the 2205A.
  2. From the install commands above I can see that numpy has installed.

I think it has something to do with the way I am structuring the download. Should I be copying the files into a particular directory?

Running the following command returned no errors:

pi@raspberrypi:~ $ python -c 'import picoscope'

This is how I have executed the program, it is not my program, its an example:

pi@raspberrypi:~ $ cd /home/pi/projects/pico-python-master/examples
pi@raspberrypi:~/projects/pico-python-master/examples $ ./ps2000_demo.py

It gets so far, as you can see:

./ps2000_demo.py: line 33: 
PS2000 Demo.

By: Colin O'Flynn, based on Mark Harfouche's software

This is a demo of how to use AWG with the Picoscope 2204 along with capture
It was tested with the PS2204A USB2.0 version

The AWG is connected to Channel A.
Nothing else is required.

NOTE: Must change line below to use with A and B series PS2000 models

See http://www.picotech.com/document/pdf/ps2000pg.en-10.pdf for PS2000 models:
PicoScope 2104
PicoScope 2105
PicoScope 2202
PicoScope 2203
PicoScope 2204
PicoScope 2205
PicoScope 2204A
PicoScope 2205A

See http://www.picotech.com/document/pdf/ps2000apg.en-6.pdf for PS2000A models:
PicoScope 2205 MSO
PicoScope 2206
PicoScope 2206A
PicoScope 2206B
PicoScope 2207
PicoScope 2207A
PicoScope 2208
PicoScope 2208A
: File name too long
from: can't read /var/mail/__future__
from: can't read /var/mail/__future__
from: can't read /var/mail/__future__
from: can't read /var/mail/__future__
./ps2000_demo.py: line 39: import: command not found
from: can't read /var/mail/picoscope
./ps2000_demo.py: line 42: import: command not found
./ps2000_demo.py: line 43: import: command not found
./ps2000_demo.py: line 46: syntax error near unexpected token `__doc__'
./ps2000_demo.py: line 46: `    print(__doc__)'

Thanks for keeping in touch, I really appreciate the help. Somethings going on with github, I keep getting logged out, and I dont seem to see your responses untill ages after.

Our examples are not set as executable for a reason, probably philosophical, but also because python2/python3 has been causing problems when people don't specify python correctly in the #! line

You should try running things with

python ps2000_demo.py

If your own code, you might want to try

#!/usr/bin/env python3
# Your python program

Interesting... I think I need to install pylab

Yeah, sorry, we aren't so good at documenting all the necessary dependencies for the examples.

Please close this issue if you feel like we addressed your original concern.

That might have actually worked in your favour since installing these high level dependencies is a pain on a RPi ;) since they don't have arm wheels.

You should raise this issue on numpy. They can probably be motivated to push for arm wheels on PyPi if they have users that care about that.

Awesome, I will. It works!! Thanks alot.

Thanks to all you guys, dont know what I would have done

glad to help.