Shantanu24
Posts: 19
Joined: Fri Dec 30, 2016 6:28 am

Installing Python Modules

Fri Dec 30, 2016 6:37 am

Hi everyone. I have just bought my first Raspberry Pi and have begin working on it. I am facing a problem.

1. I am trying to install the pyBarcode module for python3. I downloaded the zip file of pyBarcode and extracted it into the python 3.4 folder using nautilus.
Then I run the setup.py file using python3 idle. Then I imported barcode ("import barcode") and it run all fine. When I restarted, it again showed "no module found". Again I run the setup.py file in idle and the problem was solved. BUT again on reboot of the idle, it shows "Module not found". I have to run the setup.py file each time I want to import barcode module. I don't understand.

2. When i try to cd into the folder that I have extracted the pyBarcode module, and i do "python3 setup.py install", I get an error saying i do not have the permission. I have tried all the net has to offer on this topic till date, but all in vain. I am not being able to install this module because I do not have permission

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Installing Python Modules

Fri Dec 30, 2016 9:46 am

The normal way to install python stuff is pip or pip3-2.

If you want to do it "by hand" from a zip file, unzip it to /tmp cd into the directory and run sudo python3 setup.py install. The installer will check for dependencies and copy the files to the right directories.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Shantanu24
Posts: 19
Joined: Fri Dec 30, 2016 6:28 am

Re: Installing Python Modules

Fri Dec 30, 2016 10:15 am

Thank you buddy. That helped. Problem solved :)

Return to “Troubleshooting”