LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   please help me use python in virtualenv on linux mint 18 (https://www.linuxquestions.org/questions/linux-newbie-8/please-help-me-use-python-in-virtualenv-on-linux-mint-18-a-4175592928/)

rivola 11-04-2016 07:49 PM

please help me use python in virtualenv on linux mint 18
 
hi,

// Installed Python3 (3.4.5) using this method: http://devmartin.com/blog/2016/04/cr...-xenial-xerus/ //
// subbed in 3.4.5 got as far as //

Creating a virtual environment with python3.4 on Ubuntu 16.04 Xenial Xerus

Ubuntu 16.04 (Xenial Xerus) has been released last week and it ships with python version 3.5. Which is great, because it offers some new features for asynchronous programming. Unfortunately, one library (PySide) that I need for the superb jupyter qtconsole doesn’t support python 3.5 yet. Thus I needed a virtual environment with python 3.4:

Install dependencies:

sudo apt install build-essential checkinstall libreadline-gplv2-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl
Get python source code:

mkdir -p $HOME/opt
cd $HOME/opt
curl -O https://www.python.org/ftp/python/3....thon-3.4.5.tgz
tar xzvf Python-3.4.5.tgz
cd Python-3.4.5
Configure & install

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

// got the following at end of output //

changing mode of /usr/local/lib/python3.4/lib-dynload/_codecs_kr.cpython-34m.so to 755
changing mode of /usr/local/lib/python3.4/lib-dynload/ to 755
changing mode of /usr/local/lib/python3.4/lib-dynload/__pycache__ to 755
running install_scripts
copying build/scripts-3.4/2to3-3.4 -> /usr/local/bin
copying build/scripts-3.4/idle3.4 -> /usr/local/bin
copying build/scripts-3.4/pydoc3.4 -> /usr/local/bin
copying build/scripts-3.4/pyvenv-3.4 -> /usr/local/bin
changing mode of /usr/local/bin/2to3-3.4 to 755
changing mode of /usr/local/bin/idle3.4 to 755
changing mode of /usr/local/bin/pydoc3.4 to 755
changing mode of /usr/local/bin/pyvenv-3.4 to 755
rm /usr/local/lib/python3.4/lib-dynload/_sysconfigdata.py
rm -r /usr/local/lib/python3.4/lib-dynload/__pycache__
Creating directory /usr/local/share/man/man1
/usr/bin/install -c -m 644 ./Misc/python.man \
/usr/local/share/man/man1/python3.4.1
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--altinstall --upgrade" ;; \
install|*) ensurepip="--altinstall" ;; \
esac; \
LD_LIBRARY_PATH=/home/user/opt/Python-3.4.5 ./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Ignoring indexes: https://pypi.python.org/simple
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-8.1.1 setuptools-20.10.1

// did not know what to do after the above so... ran the following command //

sudo apt-get intall virtualenv

// "seems" to have installed i'm thinking well this is good so i then ran... //

sudo apt-get install python3 virtualenvwrapper

// which towards then end of execution spits out... //

Registering documents with scrollkeeper...
Setting up libjs-jquery (1.11.3+dfsg-4) ...
Setting up libjs-underscore (1.7.0~dfsg-1ubuntu1) ...
Setting up libjs-sphinxdoc (1.3.6-2ubuntu1) ...
Setting up python-pbr (1.8.0-4ubuntu1) ...
update-alternatives: using /usr/bin/python2-pbr to provide /usr/bin/pbr (pbr) in auto mode
Setting up python-stevedore (1.12.0-1) ...
Setting up python-virtualenv (15.0.1+ds-3) ...
Setting up virtualenv-clone (0.2.5-1) ...
Setting up virtualenvwrapper (4.3.1-2) ...


// thinking well that ain't good so i then then ran... //

which virtualenv

// spits out... //

/usr/bin/virtualenv

?????????????????????????????

Ok so i'm a total newb to linux seems i've gotten things a bit confused. Frankencommand approach not good. What are we looking at here? Can someone please tell me based on the above what i need to tweak or add or remove so that i can work with python 3.4 using virtualenv? The plan is if I do it this way then at some point I can use a later or earlier build of python based on my needs in order to program what I want to program. Please don't say "Well why do you need to work with python build xx.xx.xxxx?" Maybe it's me (yeah admittedly i can be dense at times) but i could not find a single well explained tutorial for doing this with these versions.

Thank You for any assistance you might be able to give.

~riv

rivola 11-04-2016 08:18 PM

// me again... also //
~ $ python3 --version
// returns... //
Python 3.5.2


ARGH,
rivola


All times are GMT -5. The time now is 08:12 AM.