2017年11月8日 星期三

[Python] Python virtual environment lib path

Method 1:

Download RPi.GPIO 0.6.3

tar xvf RPi.GPIO-0.6.3.tar.gz

cd RPi.GPIO-0.6.3

Start to build the C code
python3 setup build

cd RPi.GPIO-0.6.3/build/lib.linux-armv7l-3.4

Copy RPi module to virtual environment of python
cp RPi /home/pi/env/lib/python3.4/site-packages (which env is virtual environment)


Method 2:

source ~/env/bin/activate

Download RPi.GPIO 0.6.3

tar xvf RPi.GPIO-0.6.3.tar.gz

cd RPi.GPIO-0.6.3

Start to build the C code and install binary and library file into the virtual environment of python path.
python3 setup install

Reference:

0 意見:

張貼留言