Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual environment does not find spidev module [solved] #78

Open
romybompart opened this issue Oct 29, 2018 · 0 comments
Open

Virtual environment does not find spidev module [solved] #78

romybompart opened this issue Oct 29, 2018 · 0 comments

Comments

@romybompart
Copy link

Hi people,
I was working outside of my virtual environment initially.
Then, I decided to move into a virtual env that I have already created, since I have to use OpenCv with some python3 dependencies already configured there. Then, when I ran the same .py that I was running before (outside of my env) I got a message:

 import spidev

ImportError: No module name 'spidev'

When I wrote: pip freeze, I noticed that my spi-dev module was not registered here.

-----Work around:

  1. I tried to install it again using>>
    sudo apt-get install sudo apt-get install python-dev
    mkdir python-spi
    cd python-spi
    wget https://raw.github.com/doceme/py-spidev/master/setup.py
    wget https://raw.github.com/doceme/py-spidev/master/spidev_module.c
    sudo python setup.py install
  2. I tried to run:
    sudo pip3 install spidev
  3. I tried to check if this has to do with the site-packages/ because in my virtual env I can see there is no spi-dev whereas outside of the virtual env the dist-package/ folder has spidev folder.

-----Solution
Then: Yes, I just copied those spidev files/folders into my virtual env corresponding folder.
Outside of my virtual env:

cd /usr/local/lib/python3.5/dist-packages
sudo cp -r spidev* ~/.virtualenvs/cv/lib/python3.5/site-packages

I hope if you have experienced this issue and fix it in another way, please let me know.
If you are having the same issue as I had and this worked for you please me know as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant