Pi Setup Python 3 MySql

From OpenCircuits
Jump to navigation Jump to search

Links[edit]



Try[edit]

sudo apt-get -y install python3-mysql.connector

but I got
pi@raspberrypi ~ $ sudo apt-get -y install python3-mysql.connector
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-mysql.connector
E: Couldn't find any package by regex 'python3-mysql.connector'


some of the struggle


pi@raspberrypi ~ $ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~ $ sudo apt-get -y install python3-mysql.connector
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-mysql.connector
E: Couldn't find any package by regex 'python3-mysql.connector'
pi@raspberrypi ~ $ sudo apt-get -y install python3-mysql.connector
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-mysql.connector
E: Couldn't find any package by regex 'python3-mysql.connector'
pi@raspberrypi ~ $ pip3
bash: pip3: command not found
pi@raspberrypi ~ $ sudo apt-get install python-pip3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-pip3
pi@raspberrypi ~ $ sudo apt-get install python3-pip3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pip3
pi@raspberrypi ~ $ sudo apt-get install python3-pymysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pymysql
pi@raspberrypi ~ $ sudo apt-get update
Hit http://mirrordirector.raspbian.org wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release.gpg                             
Hit http://mirrordirector.raspbian.org wheezy Release                               
Hit http://raspberrypi.collabora.com wheezy Release
Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages                                           
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages                                    
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages                                                         
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages                                                              
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_US                                                             
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en                                                                
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_US                                 
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en                                    
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_US                                    
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en                                       
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_US                                
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en                                   
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_US                                     
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en                                        
Ign http://archive.raspberrypi.org wheezy Release.gpg                                                   
Ign http://archive.raspberrypi.org wheezy Release
Err http://archive.raspberrypi.org wheezy/main armhf Packages                 
  503  Service Unavailable [IP: 93.93.128.230 80]
Ign http://archive.raspberrypi.org wheezy/main Translation-en_US
Ign http://archive.raspberrypi.org wheezy/main Translation-en
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/wheezy/main/binary-armhf/Packages  503  Service Unavailable [IP: 93.93.128.230 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
pi@raspberrypi ~ $ sudo apt-get update
Hit http://mirrordirector.raspbian.org wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release.gpg                          
Hit http://raspberrypi.collabora.com wheezy Release                              
Hit http://mirrordirector.raspbian.org wheezy Release      
Get:1 http://archive.raspberrypi.org wheezy Release.gpg [488 B]
Hit http://archive.raspberrypi.org wheezy Release                                 
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages                    
Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages                                            
Hit http://archive.raspberrypi.org wheezy/main armhf Packages                                                                                                    
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages                                                                                             
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages                                                                                            
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages                                                                                                 
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_US                                                                                                
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en                                                                                                   
Ign http://archive.raspberrypi.org wheezy/main Translation-en_US                                                                           
Ign http://archive.raspberrypi.org wheezy/main Translation-en                                        
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_US                                                                                                                    
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en                                                                                                                       
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_US                                                                                                                       
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en                                                                                                                          
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_US                                                                                                                   
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en                                                                                                                      
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_US                                                                                                                        
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en                                                                                                                           
Fetched 488 B in 24s (19 B/s)                                                                                                                                                              
Reading package lists... Done
pi@raspberrypi ~ $ sudo apt-get install python3-pymysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pymysql
pi@raspberrypi ~ $ sudo apt-get install python3-pip3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pip3
pi@raspberrypi ~ $ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libmysqlclient16
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  python3-dev python3-pkg-resources python3-setuptools python3.2-dev
The following NEW packages will be installed:
  python3-dev python3-pip python3-pkg-resources python3-setuptools python3.2-dev
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 31.3 MB of archives.
After this operation, 39.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3.2-dev armhf 3.2.3-7+deb7u1 [30.9 MB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-dev all 3.2.3-6 [1,062 B]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-pkg-resources all 0.6.24-1 [33.9 kB]                                                                                
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-setuptools all 0.6.24-1 [363 kB]                                                                                    
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-pip all 1.1-3 [79.7 kB]                                                                                             
Fetched 31.3 MB in 22s (1,413 kB/s)                                                                                                                                                        
Selecting previously unselected package python3.2-dev.
(Reading database ... 105844 files and directories currently installed.)
Unpacking python3.2-dev (from .../python3.2-dev_3.2.3-7+deb7u1_armhf.deb) ...
Selecting previously unselected package python3-dev.
Unpacking python3-dev (from .../python3-dev_3.2.3-6_all.deb) ...
Selecting previously unselected package python3-pkg-resources.
Unpacking python3-pkg-resources (from .../python3-pkg-resources_0.6.24-1_all.deb) ...
Selecting previously unselected package python3-setuptools.
Unpacking python3-setuptools (from .../python3-setuptools_0.6.24-1_all.deb) ...
Selecting previously unselected package python3-pip.
Unpacking python3-pip (from .../python3-pip_1.1-3_all.deb) ...
Processing triggers for man-db ...
Setting up python3.2-dev (3.2.3-7+deb7u1) ...
Setting up python3-dev (3.2.3-6) ...
Setting up python3-pkg-resources (0.6.24-1) ...
Setting up python3-setuptools (0.6.24-1) ...
Setting up python3-pip (1.1-3) ...
pi@raspberrypi ~ $ sudo apt-get install python3-pymysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pymysql
pi@raspberrypi ~ $ pip3
bash: pip3: command not found
pi@raspberrypi ~ $ python3-pip
bash: python3-pip: command not found
pi@raspberrypi ~ $ pip
Usage: pip COMMAND [OPTIONS]

pip: error: You must give a command (use "pip help" to see a list of commands)
pi@raspberrypi ~ $ pip install python3-pymysql
Downloading/unpacking python3-pymysql
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement python3-pymysql
No distributions at all found for python3-pymysql
Storing complete log in /home/pi/.pip/pip.log
pi@raspberrypi ~ $ 


add library to arduino[edit]

raspberry pi add library to arduino

Libraries go in '/home/pi/sketchbook/libraries'. Also make sure the directory you put in there has the correct name (rename it to 'Adafruit_NeoPixel' if it hasn't got that name already).