Python 3.4 on Ubuntu 16.04 - Ask Ubuntu


i have installed python 3.4 on ubuntu 16.04 using ./configure, make, make install process. trying install flask, , having issues using pip in virtualenv created 3.4. using pip installs python 2.7, pip3 installs 3.5. trying other method produces errors.

how invoke pip python 3.4.3?

revised creating virtual environment python3.4 on ubuntu 16.04 xenial xerus:

  1. install dependencies.

    sudo apt install build-essential checkinstall   sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev openssl   
  2. get python3.4 source code.

    mkdir -p $home/opt   cd $home/opt   curl -o https://www.python.org/ftp/python/3.4.3/python-3.4.3.tgz   tar xzvf python-3.4.3.tgz   cd python-3.4.3 
  3. configure , install.

    ./configure --enable-shared --prefix=/usr/local ldflags="-wl,--rpath=/usr/local/lib"   sudo make altinstall   

    --enable-shared necessary libraries. --prefix needed reasons (more information in this answer). make altinstall keeps python3.5 installation default one.

  4. create python3.4 virtualenv.

    now can create new virtual environment , activate it:

    python3.4 -m venv python3.4virtualenv   . python3.4virtualenv/bin/activate 

pip3 installed default when python 3.4 virtual environment created. list installed packages:

pip3 list 

returns

flask (0.11.1)     

type flask --help show flask help. output shows flask has been installed in python virtual environment python 3.4.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User