Hacker News new | comments | show | ask | jobs | submit login
Tensorflow Python 2.7 vs. Python 3.5: What is your setup?
7 points by noloblo 160 days ago | hide | past | web | favorite | 11 comments
how do you switch back and forth between 2.7 and 3.5

I am tired of getting 2.7 library errors every time every time I try to run 3.5 project. What is your ideal set up how do you maintain python path for two different versions of the language

Any thoughts advising best practices appreciated




Well, i am suprised nobody say a word about Pyenv:

https://github.com/pyenv/pyenv

You can use a lot of python versions, including pypy.


virtualenvs, and outside of those taking care to always have proper

    #!/usr/bin/env pythonX 
lines at the top.


virtualenvs? can you please elaborate



How is this a treat not clear it's not straightforward and not obvious as to how to switch back-and-forth between 2.7 and 3.5 why are there two dangling versions


for projects you only use with one Python version, you have a virtualenv per project, with the right version, and enable the virtualenv when you work on that project. (or you only do that for the python version you use less, but virtualenvs have more benefits than just managing python versions). If you need to test something with two versions, you have one env per python version and enable whichever one you need.


How do you switch back-and-forth


From the page I linked:

> To begin using the virtual environment, it needs to be activated:

> $ source my_project/bin/activate


I'm just looking for the gist or the recipe for virtual env switching back-and-forth


I use Anaconda, which supports different concurrent installs


I use Python 3.6 in an Anaconda env




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: