Created
June 15, 2022 15:13
-
-
Save yoandresaav/37226bad8338276c7ac1b64e40c98f21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python3 Encapsulate with sqlite3 Maps (https://stackoverflow.com/questions/19530974/how-can-i-add-the-sqlite3-module-to-python) | |
Here is an example of a script that will setup an encapsulated version (virtual environment) of Python3 in your user directory with an encapsulated version of sqlite3. | |
INSTALL_BASE_PATH="$HOME/local" | |
cd ~ | |
mkdir build | |
cd build | |
[ -f Python-3.6.2.tgz ] || wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz | |
tar -zxvf Python-3.6.2.tgz | |
[ -f sqlite-autoconf-3240000.tar.gz ] || wget https://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz | |
tar -zxvf sqlite-autoconf-3240000.tar.gz | |
cd sqlite-autoconf-3240000 | |
./configure --prefix=${INSTALL_BASE_PATH} | |
make | |
make install | |
cd ../Python-3.6.2 | |
LD_RUN_PATH=${INSTALL_BASE_PATH}/lib configure | |
LDFLAGS="-L ${INSTALL_BASE_PATH}/lib" | |
CPPFLAGS="-I ${INSTALL_BASE_PATH}/include" | |
LD_RUN_PATH=${INSTALL_BASE_PATH}/lib make | |
./configure --prefix=${INSTALL_BASE_PATH} | |
make | |
make install | |
cd ~ | |
LINE_TO_ADD="export PATH=${INSTALL_BASE_PATH}/bin:\$PATH" | |
if grep -q -v "${LINE_TO_ADD}" $HOME/.bash_profile; then echo "${LINE_TO_ADD}" >> $HOME/.bash_profile; fi | |
source $HOME/.bash_profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment