0

Previously I was at

> port select --list python
..
python27 (active)
..

Now, even after

> sudo port select --set python python36

and

> pip install autoenv==1.0.0

I still find that activate.sh

> which activate.sh
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/activate.sh

points to 2.7.

Now I'd like to replace the previous call

> echo "source `which activate.sh`" >> ~/.bash_profile

with a fresh one for Python 3(.6).

How do I properly engage autoenv and activate.sh for Python 3.6? I am guessing that the existence of /opt/local/Library/Frameworks/Python.framework/Versions/2.7 should be unnecessary.

Calaf
  • 10,113
  • 15
  • 57
  • 120

1 Answers1

0

activate.sh from autoenv is written in shell and doesn't mention Python in any way. It should work with any directory that has .env. So you actually don't need to reinstall it. But if you still want — pip install usually installs for Python 2. Use

pip uninstall autoenv
pip3 install autoenv

to uninstall autoenv for Python 2 and install it for Python 3.

phd
  • 82,685
  • 13
  • 120
  • 165
  • Looking forward at the stability of the system, when Python 2.x will never even be installed: After running `sudo port select --set pip pip36` (now pip is a symlink to pip36) and `sudo pip install autoenv`, there is no `activate.sh` in my path. I appreciate that `activate.sh` is just a bash file, but it should still appear somehow for a purely 3.x Python installation, no? – Calaf Sep 06 '17 at 20:49
  • It must appear, bu not neccessary in your path. It could be in `/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/` or `/usr/local/bin/`. – phd Sep 06 '17 at 21:17
  • Ah.. yes.. it did indeed appear (in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin). I can also confirm that it's identical (in timestamp too) to the one installed under 2.7. – Calaf Sep 07 '17 at 01:11