python3 and virtualenv

Predrag Punosevac predragp at cs.cmu.edu
Thu Sep 15 22:43:29 EDT 2016


Kirthevasan Kandasamy <kandasamy at cmu.edu> wrote:

> Hi Predrag,
> 
> Can you please install python3 in the machines?

Please check 

/opt/rh/rh-python35/root/bin

use virtualenv-3.5 and pip3.5 to set up your environment. You must use
absolute paths or adjust your shell profile. python35 is only available
on the computing nodes running RHEL 7.2. I am planning to phase out 6.8
firstly from desktops and then remaining computing nodes gradually.

Predrag


P.S. Before people jump on 3.5 I must remind you that 3.5 is a new
language comparing to 2.7 branch. If you are writing new code great.
However there is a tons of code which is written for 2.7 and will not
work on 3.5. Porting is highly non-trivial and you will have to work
with upstream.

> 
> I wanted to set up a virtualenv with python3 but I get this error:
> kkandasa at gpu1$ virtualenv --always-copy -p python3 test1
> The executable python3 (from --python=python3) does not exist
> 
> But even if I try without python3 I get the followign error:
> 
> kkandasa at gpu1$ virtualenv --always-copy test1
> Cannot find file lib (bad symlink)
> New python executable in test1/bin/python
> Traceback (most recent call last):
>   File "/usr/bin/virtualenv", line 3, in <module>
>     virtualenv.main()
>   File "/usr/lib/python2.7/site-packages/virtualenv.py", line 821, in main
>     symlink=options.symlink)
>   File "/usr/lib/python2.7/site-packages/virtualenv.py", line 956, in
> create_environment
>     site_packages=site_packages, clear=clear, symlink=symlink))
>   File "/usr/lib/python2.7/site-packages/virtualenv.py", line 1377, in
> install_python
>     shutil.copyfile(py_executable_base, full_pth)
>   File "/usr/lib64/python2.7/shutil.py", line 82, in copyfile
>     with open(src, 'rb') as fsrc:
> IOError: [Errno 2] No such file or directory: 'python'
> 
> I will mostly be using gpu1 and gpu2 for this project.
> 
> samy


More information about the Autonlab-users mailing list